0
使用下面的HTML和我需要的目標只有在他們4名或更少的項目旋轉木馬,也就是第二個在這個例子:JQuery的:通過目標的div具有相同的類名有多少孩子/後代有
<div class="book_carousel">
<h2 class="type_one">Carousel 1</h2>
<a class="prev disabled">Previous Item</a>
<div class="scrollable">
<div class="items">
<div class="item">
<a href="http://www.place.com" class="thumb"><img src="image.jpg"></a>
<p>Info</p>
<a class="button" href="#">LOOK</a>
</div>
<div class="item">
<a href="http://www.place.com" class="thumb"><img src="image.jpg"></a>
<p>Info</p>
<a class="button" href="#">LOOK</a>
</div>
<div class="item">
<a href="http://www.place.com" class="thumb"><img src="image.jpg"></a>
<p>Info</p>
<a class="button" href="#">LOOK</a>
</div>
<div class="item">
<a href="http://www.place.com" class="thumb"><img src="image.jpg"></a>
<p>Info</p>
<a class="button" href="#">LOOK</a>
</div>
</div>
</div>
<a class="next">Next Item</a>
</div>
<div class="book_carousel">
<h2 class="type_one">Carousel 1</h2>
<a class="prev disabled">Previous Item</a>
<div class="scrollable">
<div class="items">
<div class="item">
<a href="http://www.place.com" class="thumb"><img src="image.jpg"></a>
<p>Info</p>
<a class="button" href="#">LOOK</a>
</div>
<div class="item">
<a href="http://www.place.com" class="thumb"><img src="image.jpg"></a>
<p>Info</p>
<a class="button" href="#">LOOK</a>
</div>
<div class="item">
<a href="http://www.place.com" class="thumb"><img src="image.jpg"></a>
<p>Info</p>
<a class="button" href="#">LOOK</a>
</div>
<div class="item">
<a href="http://www.place.com" class="thumb"><img src="image.jpg"></a>
<p>Info</p>
<a class="button" href="#">LOOK</a>
</div>
<div class="item">
<a href="http://www.place.com" class="thumb"><img src="image.jpg"></a>
<p>Info</p>
<a class="button" href="#">LOOK</a>
</div>
</div>
</div>
<a class="next">Next Item</a>
</div>
一旦我得到了與它四個或更少項目的div保持,這個想法是,我會關掉傳送帶,因爲這不會是neccessary
那太好了,謝謝 – user2383847