So i have an Owl Carousel that contains three images. I also added custom navigation arrows (.png images) on left and right sides. However, those arrows are currently useless, because I can't find a way to actually make them switch between images of my Owl Carousel. I searched endlessly and can't find the solution. Any ideas?
Setting of the responsive is very simple. Structure of responsive option: responsive : { // breakpoint from 0 up 0 : { option1 : value, option2 : value, ... }, // breakpoint from 480 up 480 : { option1 : value, option2 : value, ... }, // breakpoint from 768 up 768 : { option1 : value, option2 : value, ... } }
Put the bellow lines instead of CSS and Javascript tags. Now wrap all slider <div> or <img> in one container <div class="owl-carousel"> . class owl-carousel is required to apply proper css styles. Also if you want to use default navigation controls, you must also include the owl-theme class in the same <div> tag.
You need to enable navigation and edit navigationText:
version 1.3.2
owlgraphic.com/owlcarousel/#customizing
Note: It appears the site for Owl 1.3 is now down, so here is a forked Codepen example.
$("#owl-example").owlCarousel({ navigation: true, navigationText: ["<img src='myprevimage.png'>","<img src='mynextimage.png'>"] });
version 2
:https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html#nav
$("#owl-example").owlCarousel({ nav: true, navText: ["<img src='myprevimage.png'>","<img src='mynextimage.png'>"] });
Personal suggestion: Use Slick over Owl
Personal suggestion update: Tiny slider is great too.
var owl = $('.owl-carousel'); owl.owlCarousel(); // Go to the next item $('.customNextBtn').click(function() { owl.trigger('owl.prev'); }) // Go to the previous item $('.customPrevBtn').click(function() { owl.trigger('owl.next'); })
var owl = $('.owl-carousel'); owl.owlCarousel(); // Go to the next item $('.customNextBtn').click(function() { owl.trigger('next.owl.carousel'); }) // Go to the previous item $('.customPrevBtn').click(function() { // With optional speed parameter // Parameters has to be in square bracket '[]' owl.trigger('prev.owl.carousel', [300]); })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With