BS Carousel
The Carousel Plugin
The Carousel plugin is a component for cycling among components, similar to a carousel (slideshow).
Tip: You can include plugins separately (using Bootstrap’s “carousel.js” file) or all at once (using “bootstrap.js” or “bootstrap.min.js”).
Carousel Example
-----example mukavu -----
Carousels are not properly supported in Internet Explorer 9 or older (since the slide effect is achieved using CSS3 transitions and animations).
How To Create a Carousel
The following example demonstrates how to make a basic carousel.
Example
Example explained
The outermost <div>:
Carousel controls must be assigned an id (in this case, id=”myCarousel“) in order to function properly.
The class=”carousel” indicates that this <div> has a carousel.
The .slide class provides a CSS transition and animation effect, causing the items to move as a new item is displayed. If you do not want this effect, omit this class.
The data-ride=”carousel” element instructs Bootstrap to start animating the carousel instantly upon page load.
The “Indicators” part:
The indicators are the small dots at the bottom of each slide (which show the number of slides in the carousel and the slide the user is now seeing).
The indications are stated in an ordered list with class .carousel-indicators.
The data-target attribute points to the carousel’s id.
When you click on a given dot, the data-slide-to attribute determines the slide you will be taken to.
The “Wrapper for slides” part:
The slides are defined in a <div> with class.carousel-inner.
The content of each slide is defined in a <div> with class .item. This could be text or an image.
One of the slides must have the .active class applied. Otherwise, the carousel won’t be visible.
The “Left and right controls” part:
This code adds “left” and “right” buttons, which allow the user to manually navigate between slides.
The data-slide attribute takes the keywords “prev” or “next“, which change the slide’s location relative to the current position.