Create a gist now

Instantly share code, notes, and snippets.

@dimsemenov /navigation-type.js Secret
Last active Dec 17, 2015

Embed
What would you like to do?
RoyalSlider detect navigation type
var byArrow,
byBullet;
$('.rsArrow').click(function() {
byArrow = true;
});
$('.rsNavItem').click(function() {
byBullet = true;
});
var sliderEv = $('.royalSlider').data('royalSlider').ev;
sliderEv.on('rsAfterSlideChange', function() {
if(byArrow) {
console.log('arrow');
} else if(byBullet) {
console.log('bullet');
} else {
console.log('swipe');
}
byArrow = byBullet = false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment