Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable bootstrap carousel animation?

For example I have carousel with 3 images, when the carousel slides the new images are added via 'slid' event

$('#imageCarousel').on('slid', function (event) {
      //add more images
});

I want to disable animation for the carousel, so transition time is set to 0 in carousel css as it was shown here removing carousel animation. But after that 'slid' event does not fire. I cannot use 'slide' event, because I need to know which item is active in the carousel, but the 'active' class is not set up after the 'slide' event. How can I solve it? Thanks.

like image 409
IgorCh Avatar asked Sep 12 '13 09:09

IgorCh


People also ask

How do I stop bootstrap carousel slider autoplay?

To turn off the autoplay set data-interval="false" to the carousel element.

How do I pause bootstrap carousel?

.carousel('pause') Stops the carousel from cycling through items.

How do I automatically make bootstrap carousel slide?

To set or to stop autoplay in Bootstrap carousel you can use data attributes or JavaScript code. You'll find detailed documentation and code examples of Bootstrap Carousel in Bootstrap Carousel Docs. Note: Autoplay for the carousel is turned on from default.


1 Answers

I suppose you can use the following code,

just remove the slide class from carousel div and use like,

<div class="carousel"> 

this will remove the slide animation effect, see the working fiddle,

like image 139
Able Alias Avatar answered Sep 23 '22 09:09

Able Alias