2011-02-09 82 views
0

我有jqueryui標籤的問題。jquery ui標籤網頁問題頁面基地

我有這樣的代碼:

//The jQuery Tabs 
$("#tabs").tabs(); 

//Code to open the correct tab if i write the hash on the url. It works fine 
var hash = window.location.hash; 
var index = $("#tabs a").index($('#link-'+hash.replace('#',''))); 
if(index>=0) $("#tabs a").eq(index).click(); 

,如果我不把在頁面基本href做它工作正常= ...我可以用鼠標右鍵打開新頁面的標籤並打開頁面,並選擇正確的選項卡。

如果我放在我的頁面base href = http:// $ _ SERVER ['HTTP_HOST']/當我用鼠標右鍵在新窗口中打開標籤時,打開的頁面不正確。只獲得頁面的基礎,失去了大部分的url。

請幫忙。對不起,我的英語

+0

你是什麼意思的頁面基地?也許一個小樣本在線會幫我理解(jsFiddle);) – Guillaume86 2011-02-09 11:31:07

回答

1

我不明白

如果我把我的頁面/」 />

位,

但最後兩行可能已經減少到一個我認爲:

$('#link-'+hash.replace('#','')).click(); 
+0

對不起,標籤,io糾正了這個問題。 – David 2011-02-09 11:23:26