【发布时间】:2023-12-28 10:39:01
【问题描述】:
我在一个网站上工作,有 2 个来自“owl-carousel”的照片滑块。
第一个滑块效果很好,但第二个滑块将所有照片放在一起。
是 jquery 的问题还是 html 的问题?
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<!-- portfolio media -->
<div class="portfolio-images">
<!-- image slider -->
<div id="owl-portfolio1" class="owl -carousel">
<div class="item active"> <img src="images/print1.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
<div class="item"> <img src="images/print2.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
<div class="item"> <img src="images/print3.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
<div class="item"> <img src="images/print4.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
<div class="item"> <img src="images/print2.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
<div class="item"> <img src="images/print3.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
<div class="item"> <img src="images/print4.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
<div class="item"> <img src="images/print2.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
<div class="item"> <img src="images/print3.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
<div class="item"> <img src="images/print4.jpg" class="img-responsive img-thumbnail" title="" alt="" /> </div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$("#owl-portfolio").owlcarousel({
});
$("#owl-portfolio").owlcarousel({
});
});
</script>
</div>
【问题讨论】:
-
介意显示导致问题的相关代码吗?
-
我想,但我不能在下面放任何东西,因为声誉低。我确实遵循了threeandme的提示,它改变了一些东西,现在只有一张图片但仍然没有滑块或按钮。
-
缺少按钮可能是由于 css。确保在 div 标签中包含相关的类。
-
@Simonsays :添加有问题的代码...不是 cmets,您只需添加它,如果需要,我会进行必要的格式化! :)
标签: javascript jquery html css owl-carousel