Bootstrap Carousel v2.0.4 restarts mouseleave event

jQuery v 1.7.2, Bootstrap v 2.0.4 (downloaded standard file from the home page this morning)

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script>$('#myCarousel').carousel({interval: false})</script>

I saw a lot of questions about this, but according to the official Bootstrap block (paragraphs 5 and 10 under the heading "Javascript"), this question should have been resolved in version 2.0.

I added a false interval for the call, since it should (according to the docs) prevent it from shifting if the user does not click on the previous / next links.

At first, it works great: loading pages, without slipping, the user clicks the next link, goes well to the next slide. But if the user pushes the mouse away from the #myCarousel container, then the sliding action starts to automate again.

What's happening? I would really like the slide to be under user control.

+2
source share
1 answer

I was unable to recreate the behavior you described.

Js feed

If you really see this behavior, you should report a problem on the Bootstrap repo .


However, if you want to completely disable the pause based on hovering, try using

$('#myCarousel').carousel({interval: 0, pause: 'none'});

This value for pausesimply should be something else 'hover'. The value for intervalsimply must be false, and I think that use 0has a greater semantical meaning, since it must be a number otherwise.

Another option is to manually turn off the mouse listeners:

$('#myCarousel').off('mouseenter').off('mouseleave');
+3
source

All Articles