Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Owl Carousel 2 beta , jump to a specific slide

Tags:

I have implemented the Owl Carousel 2 in my website , I want to be able to jump to specific slide by using the Jumbpto helper provided like so ,

$('.btnJump').click(function(){     $('#myCarousel').trigger('owl.jumpTo', 3)   }); 

but it seems that the beta version doesn't have owl.jumpTo helper.

anyhelp ? at least for finding the documentation for the beta version

like image 554
Yazan Rawashdeh Avatar asked Sep 14 '14 13:09

Yazan Rawashdeh


People also ask

How do you show only one item on Owl carousel?

If you want the Owl Carousel only display one image at a time instead of a few images, please pass the option singleItem: true in the object, the setup codes should be: $(document). ready(function(){ $(". owl-carousel").

How do you change transitions in Owl carousel?

Use transitionStyle option to set transtion. There are four predefined transitions: "fade" , "backSlide" , goDown and scaleUp . You can also build your own transition styles easily. For example by adding "YourName" value transitionStyle: "YourName" , owlCarousel will add .


2 Answers

Try:

$('.btnJump').click(function(){     $('#myCarousel').trigger('to.owl.carousel', 3)   }); 

Documentation can be found here: https://owlcarousel2.github.io/OwlCarousel2/docs/api-events.html

like image 66
Bababob Avatar answered Oct 07 '22 19:10

Bababob


For Owl Carousel 2.x.x I try this if you want to jump to item 0 with animation

$('#myowl').trigger('to.owl.carousel', [0,0,true]) 
like image 27
Tiger developer Avatar answered Oct 07 '22 19:10

Tiger developer