Questionschange number of slides on bxslider depending on screensize
mmWebetutorial Staff asked 2 months ago

var windowWidth = $(window).width();

var obxSettings = {..};

slider.bxSlider(obxSettings);

$(window).resize(function() {

windowWidth = $(window).width();

if(windowWidth < 768) {

obxSettings.minSlides = 2;

slider.reloadSlider();

} else {

obxSettings.minSlides = 3;

slider.reloadSlider();

}

}

);

1 Answers
mmclara clara answered 2 months ago

You can also use destroyShow() function to stop current bxslider functionality.

destroyShow function call same as reloadshow function for implement new duplicate bxslider but before new bxslider function.

var slider =  $('#bxslider').bxSlider( { ... } );
slider.reloadShow(); 

// or slider.destroyShow(); $('#bxslider').bxSlider( { ... } );

 

 

Your Answer
Login
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.