我页面上多个选项卡的代码(动态显示这些选项卡和内容):
jQuery('.tab-block li a').click(function() {
var theitem = jQuery(this);
theitem.parent().parent().find("li").removeClass("active");
theitem.parent().addClass("active");
theitem.parent().parent().parent().parent().find(".tab-content > ul > li").removeClass("active");
theitem.parent().parent().parent().parent().find(".tab-content > ul > li").eq(theitem.parent().index()).addClass("active");
return false;
});
在我的 HTML 中显示标签的代码:
<div class="tab-block">
<div class="tabs">
<ul>
<li class="active"><a href="#">TAB 1</a></li>
<li><a href="#">TAB 2</a></li>
</ul>
<div class="clear-float"></div>
</div>
<div class="tab-content">
<ul>
<li class="active">
<p><h3><a href="http://www.google.com/" rel="nofollow" target="_blank">Goole.com</a></h3></a>
<p>Content</p>
</li>
<li>
<p><h3><a href="http://www.google.com/" rel="nofollow" target="_blank">Goole.com</a></h3></a>
<p>Content</p>
</li>
</ul>
</div>
</div>
现在所有选项卡都运行良好,但不会打开任何链接(选项卡本身内的 H3 链接)。任何想法我做错了什么?谢谢你。