Skip to content

Instantly share code, notes, and snippets.

@dimsemenov
Last active December 17, 2015 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimsemenov/56a789ae06bbae049acb to your computer and use it in GitHub Desktop.
Save dimsemenov/56a789ae06bbae049acb to your computer and use it in GitHub Desktop.
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