2011-02-09 86 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