如何在主要猫头鹰包装外移动.owl-pagination? OwlCarousel2

时间:2015-01-07 10:20:30

标签: javascript owl-carousel

如果有一种简单的方法可以将.owl-pagination移动到主要猫头鹰包装外的另一个div,那将会很棒。想知道是否有直接的方法来实现这一目标?

2 个答案:

答案 0 :(得分:6)

适用于标准选项: navContainer dotsContainer

HTML

<!-- html custom containers -->
<div id="customNav" class="owl-nav"></div>
<div id="customDots" class="owl-dots"></div>

的javascript

$('#owl-carousel').owlCarousel({
    // move navContainer outside the primary owl wrapper
    navContainer: '#customNav',
    // move dotsContainer outside the primary owl wrapper
    dotsContainer: '#customDots',

   // other OwlCarousel2 options
})

对于OwlCarousel2问题663Full screen result in JsFiddle

答案 1 :(得分:4)

您可以在init之后移动导航,如下例所示: http://owlgraphic.com/owlcarousel/demos/navOnTop2.html

$(document).ready(function() {

  $("#owl-demo").owlCarousel({
    navigation:true,
    afterInit : function(elem){
      var that = this
      that.owlControls.prependTo(elem)
    }
  });

});