bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Add pause on :hover to carousel

Open tommls opened this issue 14 years ago • 11 comments

Otherwise it goes by too fast without changing the speed option. Zurb Foundation has some nice carousel options to borrow from...

tommls avatar Feb 13 '12 19:02 tommls

two similar google groups comments with similar requests:

http://groups.google.com/group/twitter-bootstrap/browse_thread/thread/9eeedbb0e68789e3/bf99468117bd669

http://groups.google.com/group/twitter-bootstrap/browse_thread/thread/21dda9f151f9f458/593cc7c9e9b09070

tommls avatar Feb 13 '12 20:02 tommls

You can try:

$('#myCarousel').hover(
    function() {
        $(this).carousel('pause');
    },
    function() {
        $(this).carousel('cycle');
    }
);

jahvi avatar Feb 13 '12 21:02 jahvi

This apparently works -- at least in Chrome 17.x which is the only thing I've tested in... Thank you, Tom

tommls avatar Feb 13 '12 21:02 tommls

+1

mneuhaus avatar Feb 15 '12 02:02 mneuhaus

I've noticed that this works on initial load, but if you use the left/right buttons, it doesn't seem to have any effect if you try to hover over the carousel area again. Thanks.

zslabs avatar Feb 18 '12 23:02 zslabs

This actually solved the aforementioned issue for me (using mouseenter instead of hover):

$('.carousel').mouseenter(function() {
    $(this).carousel('pause');
}).mouseleave(function() {
    $(this).carousel('next');
}); 

Thanks!

zslabs avatar Feb 18 '12 23:02 zslabs

Strange, hover is supposed be a wrapper function to mouseenter/mouseleave

jahvi avatar Feb 19 '12 01:02 jahvi

added a pause on hover option to carousel in 2.0.2

fat avatar Feb 25 '12 05:02 fat

Thanks for that!

mt33 avatar Feb 26 '12 23:02 mt33

I want to prevent from sliding on page load, and then when I hover carousel-indicators list item, It will show the hovered list item. How can I do that?

rjva avatar Aug 26 '15 08:08 rjva

Hi @rjva , I'm afraid we can't answer these sorts of "how to" requests. I'd suggest trying on StackOverflow - see https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker

patrickhlauke avatar Aug 26 '15 08:08 patrickhlauke