Bootstrap Carousel Plugin

The Bootstrap carousel is a flexible, responsive way to add a slider to your site. In addition to being responsive, the content is flexible enough to allow images, iframes, videos, or just about any type of content that you might want.

The Carousel plugin is a component for cycling through elements, like a carousel (slideshow).

The Bootstrap carousel is a flexible, responsive way that is used to add a slider to your webpage. It is very responsive and flexible enough to allow, images, iframes, videos, or any other type of content that you want to add.

The Carousel Plugin:

The carousel plugin is a component for cycling through element, like a carousel. If you want to add plugin functionality individually, then you have to use carousel.js file or all at once (using "bootstrap.js" or "bootstrap.min.js").

Usage

  • Via data attributes − Use data attributes to easily control the position of the carousel.

    • Attribute data-slide accepts the keywords prev or next, which alters the slide position relative to its current position.

    • Use data-slide-to to pass a raw slide index to the carousel data-slide-to = "2", which shifts the slide position to a particular index beginning with 0.

    • The data-ride = "carousel" attribute is used to mark a carousel as an animation starting at page load.

  • Via JavaScript − The carousel can be manually called with JavaScript as below −

Example -