我已经忙了一段时间了,问了很多问题。
但这里是整个代码,它是关于第二个旋转木马不能工作,第一个工作得很好。
谢谢。http://pastebin.com/wtPgi4cV
要同时使用更多的owl-carousel,只需使用不同的"id"
javascript$(document).ready(function() {
$("#owl-demo1").owlCarousel();
$("#owl-demo2").owlCarousel();
});
html
<div id="owl-demo1" class="owl-carousel">
<div class="item"><img src="slide1.jpg"></div>
<div class="item"><img src="slide2.jpg"></div>
<div class="item"><img src="slide3.jpg"></div>
<div class="item"><img src="slide4.jpg"></div>
<div class="item"><img src="slide5.jpg"></div>
<div class="item"><img src="slide6.jpg"></div>
</div>
<div id="owl-demo2" class="owl-carousel">
<div class="item"><img src="slide7.jpg"></div>
<div class="item"><img src="slide8.jpg"></div>
<div class="item"><img src="slide9.jpg"></div>
<div class="item"><img src="slide10.jpg"></div>
<div class="item"><img src="slide11.jpg"></div>
<div class="item"><img src="slide12.jpg"></div>
</div>
HTML
<div class="crousel-set">
<div class="item"><img src="slide1.jpg"></div>
<div class="item"><img src="slide2.jpg"></div>
<div class="item"><img src="slide3.jpg"></div>
<div class="item"><img src="slide4.jpg"></div>
<div class="item"><img src="slide5.jpg"></div>
<div class="item"><img src="slide6.jpg"></div>
</div>
<div class="crousel-set">
<div class="item"><img src="slide7.jpg"></div>
<div class="item"><img src="slide8.jpg"></div>
<div class="item"><img src="slide9.jpg"></div>
<div class="item"><img src="slide10.jpg"></div>
<div class="item"><img src="slide11.jpg"></div>
<div class="item"><img src="slide12.jpg"></div>
</div>
JavaScript $(document).ready(function() {
$(".crousel-set").each(function(index, crousel) {
crousel.owlCarousel();
});
});