How come dots/navigation buttons are not visiable using owlcarousel?

余生长醉 提交于 2020-01-02 01:36:06

问题


How come the navigation buttons are not visible?

I'm using jQuery and owlcarousel (http://owlgraphic.com/owlcarousel/).

http://jsfiddle.net/bobbyrne01/s10bgckL/1/

html ..

<div id="owl-demo">
    <div class="item">
        <img src="http://placehold.it/50x50" alt="Owl Image" />
    </div>
    <div class="item">
        <img src="http://placehold.it/50x50" alt="Owl Image" />
    </div>
    <div class="item">
        <img src="http://placehold.it/50x50" alt="Owl Image" />
    </div>
    <div class="item">
        <img src="http://placehold.it/50x50" alt="Owl Image" />
    </div>
    <div class="item">
        <img src="http://placehold.it/50x50" alt="Owl Image" />
    </div>
    <div class="item">
        <img src="http://placehold.it/50x50" alt="Owl Image" />
    </div>
    <div class="item">
        <img src="http://placehold.it/50x50" alt="Owl Image" />
    </div>
    <div class="item">
        <img src="http://placehold.it/50x50" alt="Owl Image" />
    </div>
</div>

js ..

$(document).ready(function () {
    $("#owl-demo").owlCarousel({

        autoPlay: 3000, //Set AutoPlay to 3 seconds
        dots: true,
        items: 2,
        itemsDesktop: [1199, 3],
        itemsDesktopSmall: [979, 3]
    });
});

css ..

#owl-demo .item {
    margin: 3px;
}
#owl-demo .item img {
    display: block;
    width: 50%;
    height: auto;
}

回答1:


The minified css file you have doesn't appear to have a style for that element: .owl-theme .owl-controls .owl-page span.

Here are the styles that are applied by the demo on the owlgraphic.com site: http://jsfiddle.net/s10bgckL/2/




回答2:


pagination:false,
navigation:true

try this




回答3:


Add CSS for Owl Carousel theme,

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.theme.min.css" />

and change,

<div id="owl-demo">

to

<div id="owl-demo" class="owl-theme">

Demo: jsfiddle link




回答4:


I believe the problem you are running into is you didn't include the Owl Carousel theme. Not sure if you are using the CDN, but look here: https://cdnjs.com/libraries/owl-carousel and make sure you include the CSS for the theme in addition to the standard CSS.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.theme.min.css" />



回答5:


Go to owl.carousel.min.js or owl.carousel.js file whatever you linked.

Find and Replace disabled with anyClass. You'll Find 6 times, enjoy!



来源:https://stackoverflow.com/questions/27405929/how-come-dots-navigation-buttons-are-not-visiable-using-owlcarousel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!