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.
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
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.
$('.carousel').carousel({
pause: 'none'
})
for Bootstrap v3.3.4
Bootstrap 4 Remove Pause on hover
$('.carousel').carousel({
interval: 2000,
cycle: true,
pause: "null"
})
For anyone still visiting this thread, in the most recent version of 4.1.3, use null without quotations. Maybe quotes were required in previous v.4 versions, but not the case now:
$('.carousel').carousel({
interval: 2000,
cycle: true,
pause: null
})