Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to prevent the Bootstrap carousel pause on mouse hover and continue automatically cycling?

Is it possible to prevent the Bootstrap carousel pause on mouse hover behaviour and continue automatically cycling through the items instead?

The documentation only mentions the default behaviour of pause: "hover", if I change the pause argument to anything else then the carousel stops working altogether so I'm not sure how to disable this default behaviour.

like image 668
Andy Bowskill Avatar asked Apr 22 '12 12:04

Andy Bowskill


People also ask

How do I stop carousel from moving automatically?

Use the [interval]="'0'" input. This will disable the auto-sliding feature. Here's the link to the Carousel Documentation.

How do I stop bootstrap carousel autoplay?

To turn off the autoplay set data-mdb-interval="false" next to a . carousel .

How do you pause bootstrap carousel hover?

We can set the function pause using data-pause="Hover", pause function makes the sliding images stop when the hover is placed on the images.

How do I change bootstrap carousel transition?

The transition duration of . carousel-item can be changed with the $carousel-transition-duration Sass variable before compiling or custom styles if you're using the compiled CSS. If multiple transitions are applied, make sure the transform transition is defined first (eg. transition: transform 2s ease, opacity .


2 Answers

I've found that a value of "false" will cause the carousel to keep cycling during a mouseover:

$('.carousel').carousel({     pause: "false" }); 

I am using Twitter Bootstrap v2.0.2

like image 129
xcer Avatar answered Sep 21 '22 13:09

xcer


You can add this to the div .carousel too instead of using javascript.

Add delay time:

data-interval="3000"

Add if it pauses on hover or not, options are true and false

data-pause="false"

Example would be:

<div id="carousel" class="carousel" data-ride="carousel" data-interval="3000" data-pause="false">

This worked for me.

like image 39
JCBrown Avatar answered Sep 18 '22 13:09

JCBrown