It would be great if there was a simple way to move .owl-pagination to another div outside the primary owl wrapper. Wondering if there is a straightforward way to accomplish this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It works with standard options: navContainer and 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
})
For OwlCarousel2 issue 663, Full screen result in JsFiddle
回答2:
You can move the navigation after init, like in this example: 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)
}
});
});