Skip to content

Instantly share code, notes, and snippets.

@pndparade
Forked from jayllellis/active-slide.js
Created September 21, 2017 17:37
Show Gist options
  • Save pndparade/7e37da548e99a8558f8728a7be3fe399 to your computer and use it in GitHub Desktop.
Save pndparade/7e37da548e99a8558f8728a7be3fe399 to your computer and use it in GitHub Desktop.
Add a class to current slide in bxSlider
$('.top-slider').bxSlider({
onSliderLoad: function(currentIndex) {
$('.top-slider').children().eq(currentIndex + 1).addClass('active-slide');
},
onSlideAfter: function($slideElement){
$('.top-slider').children().removeClass('active-slide');
$slideElement.addClass('active-slide');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment