Bootstrap JavaScript Carousel Doesn't Stop Cycling

前端 未结 11 1738
离开以前
离开以前 2020-12-29 02:25

Twitter Bootstrap Version: 2.0.3

Example HTML code:




        
11条回答
  •  余生分开走
    2020-12-29 03:07

    You might want to try removing the "pause" attribute. It's not necessary if you are not automatically cycling through the images. My assumption (and I'm going to look at the bootstrap code to verify) is that when the "mouseleave" event fires, the cycling resumes -- even if it was turned off in the first place. When it resumes, it uses the default speed.

    Here is a solution:

    $(function() {
        $('.carousel').each(function(){
            $(this).carousel({
                interval: false
            });
        });
    });​
    

提交回复
热议问题