有人可以告诉我我在这里做错了什么。尝试将类属性删除/添加到 li 以便在单击时激活正确的属性:http: //jsfiddle.net/cyberpuunk/D2RLR/2372/
<div class="container">
<div class="span8">
<ul class="nav nav-tabs gallery-nav">
<li class="active">
<a href="#"<strong>All</strong></a>
</li>
<li><a href="#"><strong>link1</strong></a></li>
<li><a href="#"><strong>link2</strong></a></li>
</ul>
</div>
<div class="row">
<div class="span12">
<div class="page1">qwer</div>
<div class="page1">asdf</div>
<div class="page1">zxcv</div>
</div>
</div>
</div>
$('.page1:gt(0)').hide();
$('ul.gallery-nav li').click(function(e) {
e.stopPropagation();
var liIndex = $(this).index();
$('.page1').hide().eq(liIndex).show();
$(this).removeClass("active");
eq(liIndex).addClass("active");
}); // end click