How to Change Bootstrap Carousel Slide Speed


Bootstrap 3 Framework provides the Carousel feature as a part of its core API. By default the elements in a Carousel slide to the next with a default time interval of 0.6 seconds ie 600ms. If you wish to change this time limit then you need to make in the CSS file provided.

Steps to provide a custom time limit for Bootstrap Carousel Slides

Note that you are not working with CDN links for Bootstrap CSS and JavaScript file. If you are then just download the css file on your locally.

Open bootstrap.css its good that you work on this version and then minify it later.

Look for class carousel-inner > .item
.carousel-inner > .item {
    position: relative;
    display: none;
    -webkit-transition: 0.6s ease-in-out left;
    -moz-transition: 0.6s ease-in-out left;
    -o-transition: 0.6s ease-in-out left;
    transition: 0.6s ease-in-out left;
}

You must change transition time here from .6s to the value you want and save.

Now open bootstrap.js file and change .emulateTransitionEnd(600) value from 600ms to the value you want.

This should get the work done! But do not that you must be working with the Bootstrap framework API version 3.0 or higher or else the code may be different.



















Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap