【发布时间】:2017-03-30 17:09:49
【问题描述】:
我有 2 个轮播,一个在另一个下,我正在使用“navContainer”功能来更改导航箭头的位置(我将它们放在滑块上方)。
当我有一个滑块时,它可以工作,但是当我有 2 个(或更多)时,两个滑块的导航都位于第一个“navhere”div 中。而不是这样,每个导航按钮都应该在自己的 div 中。
您可以更好地了解我在这里所说的内容:http://jsfiddle.net/vnpm1y06/226/
代码是:
<div class="about">
<div id="navhere"></div> <!-- This is where nav should appear -->
<div class="owl-carousel">
<div class="item"><h4>About</h4></div>
<div class="item"><h4>Us</h4></div>
</div>
</div>
<div class="contact">
<div id="navhere"></div> <!-- This is where nav should appear -->
<div class="owl-carousel">
<div class="item"><h4>Contact</h4></div>
<div class="item"><h4>Form</h4></div>
</div>
</div>
jquery 是
.owlCarousel({
loop: true,
margin: 10,
nav: true,
dots:false,
items:1,
navContainer: '#navhere'
})
【问题讨论】:
-
在这里工作得很好:jsfiddle.net/vnpm1y06/226。是的,它显示两个是因为有两个滑块。每个滑块都有自己的导航。
-
确实如此,它们滑动,但两个滑块的导航存储在第一个“navhere”div 中。他们应该各自在自己的 div 中。 aka,第二个 div“navhere”是空的,这就是第二张幻灯片的导航应该显示的地方
-
从脚本中移除 navcontainer 并通过 css 管理他们的位置。
标签: jquery owl-carousel