gpt4 book ai didi

用于过滤问题的 Jquery 同位素

转载 作者:行者123 更新时间:2023-11-28 08:58:26 26 4
gpt4 key购买 nike

我正在尝试实现 Jquery Isotope。当我单击列表项中的过滤器时,没有任何反应。这些元素不会过滤或动画。如果有人可以提供帮助,那就太好了!谢谢!

Jfiddle:http://jsfiddle.net/77skuLsf/2/

HTML:

<!-- Case Selection List -->
<div id="list">
<ul>
<li><a href="#" class="selected" data-filter="*">All</a></li>
<li><a href="#" data-filter=".academic">Academic</a></li>
<li><a href="#" data-filter=".architecture">Architecture</a></li>
<li><a href="#" data-filter=".communication">Communication</a></li>
<li><a href="#" data-filter=".art">Art & Culture</a></li>
<li><a href="#" data-filter=".merchandising">Merchandising</a></li>
<li><a href="#" data-filter=".entertainment">Entertainment</a></li>
<li><a href="#" data-filter=".design">Design</a></li>
<li><a href="#" data-filter=".industry">Industry</a></li>
<li><a href="#" data-filter=".medical">Medical</a></li>
</ul>
</div> <!-- List -->

<!-- ******Case Gallery Section****** -->
<section class="casestudy section">
<div class="container">
<h2 class="title text-center">More customer success stories</h2>
<div class="row">
<div class="communication casestudy text-center col-md-4 col-sm-4 col-xs-12">
<h3 class="title"><span class=""><img class="img-responsive" src="assets/images/logos/loreal.jpg" alt="" /></span><br /><span class="text">L'Oreal</span></h3>
<p>Download the free Augment app on your <a href="https://itunes.apple.com/us/app/augment/id506463171?l=en&ls=1&mt=8" target="_blank">iPad, iPhone</a> or <a href="https://play.google.com/store/apps/details?id=com.ar.augment&feature=search_result" target="_blank">Android.</a></p>
</div><!--//case-->
<div class="merchandising casestudy text-center col-md-4 col-sm-4 col-xs-12">
<h3 class="title"><span><img class="img-responsive" src="assets/images/logos/loreal.jpg" alt="" /></span><br /><span class="text">Upload your 3D files</span></h3>
<p>Ask your designers or vendors to <a href="pricing.php">upload</a> your 3D designs on Augment Manager.</p>
</div><!--//case-->
<div class="entertainment casestudy text-center col-md-4 col-sm-4 col-xs-12">
<h3 class="title"><span><img class="img-responsive" src="assets/images/logos/loreal.jpg" alt="" /></span><br /><span class="text">Simulate your 3D models</span></h3>
<p>Watch our <a style="cursor:pointer;" data-toggle="modal" data-target="#modal-video3">"Getting Started" video</a> to learn more about gestures, tracking and tools.</p>
</div><!--//case-->
</div><!--//row-->

</div><!--//container-->
</section><!--//steps-->

CSS

.casestudy {
padding-top: 60px;
padding-bottom: 60px;
}
.casestudy .title {
font-size: 36px;
font-weight: 300;
margin-top: 0;
margin-bottom: 60px;
}
.casestudy .casestudy {
padding: 30px 60px;
color: #666666;
}
.casestudy .casestudy .title {
text-align: center;
font-size: 16px;
margin-bottom: 15px;
}
.casestudy .casestudy .title .number {
width: 90px;
height: 90px;
display: block;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
text-align: center;
background: #ED2D25;
border: 5px solid #ED2D25;
color: #fff;
margin: 0 auto;
padding-top: 25px;
font-size: 26px;
font-weight: bold;
font-family: arial, sans-serif;
margin-bottom: 30px;
}
.casestudy .casestudy .title .text {
color: #ED2D25;
font-weight: bold;
font-size: 16px;
}
.casestudy .btn-cta-primary {
margin: 0 auto;
margin-top: 0px;
font-size: 20px;
}

Jquery

$(document).ready(function() {

var $container = $('.casestudy');
$container.isotope({
filter: '*',
animationOptions: {
duration: 750,
easing: 'linear',
queue: false,
}
});

$('#list ul a').click(function(){
var selector = $(this).attr('data-filter');
$container.isotope({
filter: selector,
animationOptions: {
duration: 750,
easing: 'linear',
queue: false,
}
});
return false;
});

});

最佳答案

我想你忘了添加 jQuery

这是一个有效的 fiddle

关于用于过滤问题的 Jquery 同位素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27034641/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com