开发者

fix bx_slider autoplay after select thumbnail

开发者 https://www.devze.com 2023-04-13 01:10 出处:网络
hello all i used bx slider to make content slider my slider work fine but i make it to work auto and use thumbs to show

hello all

i used bx slider to make content slider

my slider work fine but

i make it to work auto and use thumbs to show

in the start he work auto fine but

if i select thumbnail to show slider stop auto play

how can i fix it

i used this code

$(function(){

  var slider = $('#bxslider').bxSlider({
    controls: false,
    auto    : true ,
    captions: true
  });


  $('#Slides a').click(function(){
   var thumbIndex = $('#Slides a').index(this);

    slider.goToSlide(thumbIndex);


    $('#Slides a').removeClass('pager-active');

    $(this).addClass('pager-active');

    return false;
  });

  $('#Slides a:first').addClass('pager-active');
});

you can chec开发者_运维百科k the site here : check the website if you don't understand me


Try this. Second argument is for stopAuto.By default it is True so when you select thumbnail to show slider stop auto play.

slider.goToSlide(thumbIndex,true);


I was struggling with this as well. Passing a boolean to goToSlide didn't work. To fix it, add this line directly after your call to slider.goToSlide(thumbIndex);

slider.startShow()

That will restart the "slide-show" starting with whatever slide it's on at the time.


I faced this problem as well and fixed is very small. Go to jquery.bxslider.js find var clickPagerBind and Add on last line el.startAuto();

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号