Created
February 24, 2017 19:56
-
-
Save verticalgrain/8de23c72797cf3de4e03a9ee3d4380c6 to your computer and use it in GitHub Desktop.
Owl Carousel go to specific slide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.js-carousel').owlCarousel({ | |
items: 3, | |
margin: 0, | |
stagePadding: 0, | |
nav: false, | |
loop: false, | |
dotsData: false, | |
mouseDrag: false | |
}); | |
$('.carousel-nav__item').on('click',function() { | |
$('.carousel-nav__item').removeClass('is-active'); | |
$(this).addClass('is-active'); | |
var index = $('.resources-carousel-nav__item').index(this); | |
$('.js-carousel').trigger('to.owl.carousel', [index, 500, true]);// 500 is the speed of the transition in ms | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment