2016-11-16 88 views
1

我有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' 
    }) 
+0

這裏可以很好地工作:http://jsfiddle.net/vnpm1y06/226/。是的,它顯示兩個,因爲兩個滑塊。每個滑塊都有自己的導航。 –

+0

它確實滑動,但兩個滑塊的導航存儲在第一個「navhere」div中。他們應該是在他們自己的div。又名第二個div「navhere」是空的,這就是第二個幻燈片的導航應該顯示的地方 – Vlidurno

+0

從腳本中刪除navcontainer並通過css管理他們的位置。 –

回答

1

不能複製的id值。它必須是獨一無二的。這就是原因。

仍然。根據this issue多個導航尚未實現!

+0

如果我使用類而不是id的話,那麼有可能嗎? – Vlidurno

+1

@Vlidurno不可能:https://github.com/OwlCarousel2/OwlCarousel2/issues/171 –

+1

恥辱,我不知道現在要做什麼,但在任何情況下,謝謝你的幫助一堆! – Vlidurno