jQuery 选项卡在厚盒内不起作用
我正在开展一个项目,其中我有一个包含“案例研究”的网站,详细信息显示在一个厚盒子中。 现在,该内容被分成 3 个 jQuery 选项卡,它们在空白页面中工作得很好,但在这个厚盒子里,它们就不行了。
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/styles.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/estilos.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/functions.js" ></script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js" ></script>
<script type="text/javascript" src="js/jquery-ui-1.8.5.custom.min.js" ></script>
<script type="text/javascript" src="js/thickbox.js" ></script>
<div id="todos">
<div id="titCuerpo"> Case studies
</div>
<div id="cuerpo">
<a href="#" class="toggleLink"><img src="imgs/arrowDown.png" align="bottom"/> Case: Community-based advocacy<br /><br /></a>
<div class="toggle" title='<img src="imgs/case.gif"> Community-based advocacy'><span style="color:#3e3e3e; font-weight:bold">
<ul class="htabs">
<li>
<a href="#situation"><div id="sit" style="background-image:url(imgs/menuOut_01.gif); background-repeat:no-repeat; width:91px; height:31px; float:left; display:block"> </div></a>
</li>
<li>
<a href="#action"><div id="act" style="background-image:url(imgs/menuOut_02.gif); background-repeat:no-repeat; width:97px; height:31px; float:left; display:block"> </div></a>
</li>
<li>
<a href="#result"><div id="res" style="background-image:url(imgs/menuOut_03.gif); background-repeat:no-repeat; width:90px; height:31px; float:left; display:block"> </div></a>
</li>
</ul>
<div class="tabs">
<div id="situation" class="tab">
aaa
</div>
<div id="action" class="tab">
aaa
</div>
<div id="result" class="tab">
aaa
</div>
</div>
<div></div>
</div>
<script>
$(document).ready(function() {
$('.toggle').hide();
$('.toggleLink').click(function() {
tb_show($(this).next('.toggle').attr('title'),'TB_inline?height=300&width=500');
$('#TB_ajaxContent').html($(this).next('.toggle').html());
return false;
});
});
remarcarSec('nav2');remarcarMenu("bot1");
jQuery(document).ready(function(){
jQuery(".tab:not(:first)").hide();
jQuery(".tab:first").show();
jQuery(".htabs a").click(function(){
stringref = jQuery(this).attr("href").split('#')[1];
jQuery('.tab:not(#'+stringref+')').hide();
if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") {
jQuery('.tab#' + stringref).show();
}
else
jQuery('.tab#' + stringref).fadeIn();
return false;
});
});
</script>
I´m working on a project, where i got a site with "case studies" and the details are show within a thickbox.
Now, this content is split into 3 jQuery tabs, that work just fine in a blank page, but inside this thickbox, they don´t.
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/styles.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/estilos.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/functions.js" ></script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js" ></script>
<script type="text/javascript" src="js/jquery-ui-1.8.5.custom.min.js" ></script>
<script type="text/javascript" src="js/thickbox.js" ></script>
<div id="todos">
<div id="titCuerpo"> Case studies
</div>
<div id="cuerpo">
<a href="#" class="toggleLink"><img src="imgs/arrowDown.png" align="bottom"/> Case: Community-based advocacy<br /><br /></a>
<div class="toggle" title='<img src="imgs/case.gif"> Community-based advocacy'><span style="color:#3e3e3e; font-weight:bold">
<ul class="htabs">
<li>
<a href="#situation"><div id="sit" style="background-image:url(imgs/menuOut_01.gif); background-repeat:no-repeat; width:91px; height:31px; float:left; display:block"> </div></a>
</li>
<li>
<a href="#action"><div id="act" style="background-image:url(imgs/menuOut_02.gif); background-repeat:no-repeat; width:97px; height:31px; float:left; display:block"> </div></a>
</li>
<li>
<a href="#result"><div id="res" style="background-image:url(imgs/menuOut_03.gif); background-repeat:no-repeat; width:90px; height:31px; float:left; display:block"> </div></a>
</li>
</ul>
<div class="tabs">
<div id="situation" class="tab">
aaa
</div>
<div id="action" class="tab">
aaa
</div>
<div id="result" class="tab">
aaa
</div>
</div>
<div></div>
</div>
<script>
$(document).ready(function() {
$('.toggle').hide();
$('.toggleLink').click(function() {
tb_show($(this).next('.toggle').attr('title'),'TB_inline?height=300&width=500');
$('#TB_ajaxContent').html($(this).next('.toggle').html());
return false;
});
});
remarcarSec('nav2');remarcarMenu("bot1");
jQuery(document).ready(function(){
jQuery(".tab:not(:first)").hide();
jQuery(".tab:first").show();
jQuery(".htabs a").click(function(){
stringref = jQuery(this).attr("href").split('#')[1];
jQuery('.tab:not(#'+stringref+')').hide();
if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") {
jQuery('.tab#' + stringref).show();
}
else
jQuery('.tab#' + stringref).fadeIn();
return false;
});
});
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
thickbox 网站 表示,它不再维护:
由于 jQuery UI 对话框 被列为这些替代方案之一并且
你已经在使用 jQuery UI,我建议切换到
jQuery UI 对话框。该对话框不会给您带来任何组合问题
与选项卡。
The thickbox website says, that it is no longer maintained:
Since the jQuery UI Dialog is listed as one of these alternatives AND
you are using jQuery UI already, I would suggest switching to the
jQuery UI dialog. The dialog will cause you no problems in combination
with the tabs.
Thickbox 现在已经相当老了,与任何较新版本的 Jquery (1.4 +) 一起使用它会出现不稳定的行为。
我建议使用 colorbox 作为替代方案,功能非常相似,而且设置也很容易。
Thickbox is now quite old and using it with any newer versions of Jquery (1.4 +) will case erratic behaviour.
I would recommend moving to colorbox as an alternative, very similar functionality and just as easy to set-up.