I want to add an extra class to the current visible slide, i dont have so much knowledge of jquery i'm trying it by following code.
$(document).ready(function(){
$('#slider1').bxSlider({
pager: 'true'
});
$(currentSlide).addClass('active-slide');
return false;
});
To add class on the first visible slide you have to call onSliderLoad. Then you continue adding and removing active-slide class with onSlideAfter call.
onSlideAfter: function (currentSlideNumber, totalSlideQty, currentSlideHtmlObject) {
$('.active-slide').removeClass('active-slide');
$('.bxslider>li').eq(currentSlideHtmlObject + 1).addClass('active-slide')
},
onSliderLoad: function () {
$('.bxslider>li').eq(1).addClass('active-slide')
},
https://jsfiddle.net/dariodev/587pqsct/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With