jquerysliderbxslider

In bxslider i want to add a class on current slide


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;
 });    

Solution

  • http://bxslider.com/options

        var slider=$('#slider1').bxSlider({
         pager: 'true',
       onBeforeSlide: function(currentSlide, totalSlides, currentSlideHtmlObject){
            $('.pager').removeClass('active-slide');   
             $(currentSlideHtmlObject).addClass('active-slide');
     //     $('#sddf').html('<p class="check">Slide index ' + currentSlide + ' of ' + totalSlides + ' total slides has completed.');
        }
    });