简体   繁体   中英

Twitter Bootstrap Carousel. How to prevent slid event from finish

I try to prevent carousel slide from execution on some conditions with little effect.

Here is my code:

$('#questionsSlider').on('slide', '', function(e) {
            if( !testGroupCompletion($('.questionGroup.active').attr('groupno')))
                if(confirm('Are you sure?'))
                    return true;
                else
                    return false;
        });

but when function returns false, not only carousel stands still but stops working at all. Anyone know what I should return to prevent sliding?

this line may help you..

again load the carousel

$('.carousel').carousel({
      $(this).carousel('pause') 
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM