Last active
February 8, 2020 13:04
-
-
Save jayllellis/a4e433b5c8b56514a6d6 to your computer and use it in GitHub Desktop.
Add a class to current slide in bxSlider
This file contains 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
$('.top-slider').bxSlider({ | |
onSliderLoad: function(currentIndex) { | |
$('.top-slider').children().eq(currentIndex).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
Oh, thanks. I updated it - the slide index didn't need to be incremented on load.