所以我试图过滤不同的类别,但我不知道如何在第二次点击时显示类别。.not(design) 不允许我在过滤后带回设计(在第二次点击时)。我不想使用按钮来显示所有内容,我只想能够像单选按钮一样打开和关闭按钮。
我希望这是有道理的,这对我来说有点难以用语言表达。
.web-buttons li 及以上部分功能运行良好
JS FIDDLE 的链接http://jsfiddle.net/mWran/1/
$('.design-button').click(function () {
$('.web-buttons li').not(this).removeClass('up')
$(this).toggleClass("up")
$('#webul li').removeClass('clicked')
$('#webul li').not('.design').toggleClass('clicked')
});
$('.branding-button').click(function () {
$('.web-buttons li').not(this).removeClass('up')
$(this).toggleClass("up")
$('#webul li').removeClass('clicked')
$('#webul li').not('.branding').toggleClass('clicked')
});
<div id="web-design-content">
<ul id="webul">
<li class="view view-first coding design branding drupal">
<img src="images/epic-electro.jpg" width="297" height="203" />
<div class="mask">
<h2 class="bebas">Epic Electro Music Blog</h2>
<p>Introducing Epic Electro: an electronic music blog showcasing electronic dance music from around the world</p>
<a class="fancybox fancybox.iframe info ostrich" href="epicelectro.html">Read More</a>
</div>
</li>
<li class="view view-first coding branding">
<img src="images/soul-of-athens.jpg" width="297" height="203" />
<div class="mask">
<h2 class="bebas">2012 Soul Of Athens</h2>
<p>Ohio University multimedia sequence class of 2012 presents Swing State: Ohio's role in the outcome of the presidential election</p>
<a class="fancybox fancybox.iframe info ostrich" href="soa.html">Read More</a>
</div>
</li>
</ul>
</div><!-- Endb Web Design content -->