【发布时间】:2011-02-09 19:22:44
【问题描述】:
我的 jqueryui 选项卡有问题。
我有这个代码:
//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();
如果我不放入页面,它可以正常工作 base href=... 我可以用鼠标右键在新页面中打开标签,页面打开时使用正确的标签已选中。
如果我放入我的页面 base href=http://$_SERVER['HTTP_HOST']/ 当我用鼠标右键在新窗口中打开选项卡时,页面打开是不正确的。只获取页面的base,丢失大部分的url。
请帮忙。对不起我的英语
【问题讨论】:
-
您所说的页面基数是什么意思?也许网上的一个小样本可以帮助我理解(jsFiddle);)
标签: javascript jquery jquery-ui-tabs