我如何将.owl分页移动到主要的猫头鹰包装纸之外? OwlCarousel2

问题描述 投票:1回答:2

如果有一种简单的方法可以将.owl-pagination移动到主猫头鹰包装程序之外的另一个div,那就太好了。想知道是否有直接的方法来完成此操作?

javascript owl-carousel
2个回答
6
投票

它与标准选​​项一起使用:navContainerdotsContainer

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问题663


4
投票

您可以在初始化后移动导航,如以下示例所示: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)
    }
  });

});
© www.soinside.com 2019 - 2024. All rights reserved.