The Bootstrap Carousel (Carousel) plugin is a flexible, responsive way to add sliders to your site. In addition, the content is flexible enough to be an image, inline frame, video, or whatever type of content you want to place.
If you want to reference the functionality of the plug-in separately, you need to reference carousel.js. Or, as mentioned in the Bootstrap Plugin Overview chapter, you can refer to the bootstrap.js or compressed version of Bootstrap.min.js.
Here is a simple slide, using the Bootstrap Carousel (Carousel) plug-in to display a generic component of a looping play element. To implement Carousel, you only need to add code with that tag. You do not need to use the Data property, just a simple class-based development.
<div id= "Mycarousel" class= "Carousel Slide" > <!--Carousel (Carousel) Indicator--<ol class= "Carousel-indicators" & Gt <li data-target= "#myCarousel" data-slide-to= "0" class= "active" ></li> <li data-target= "#myCarousel" D ata-slide-to= "1" ></li> <li data-target= "#myCarousel" data-slide-to= "2" ></li> </ol> <!--Carousel (Carousel) Items--<div class= "Carousel-inner" > <div class= "Item Active" > </div> <div class= "Item" > </div> < ;d IV class= "Item" > </di V> </div> <!--carousel (Carousel) nav-<a class= "Carousel-control left" href= "#myCarousel" D Ata-slide= "PREV ">‹ </a> <a class= "Carousel-control right" href= "#myCarousel" data-slide= "Next" >› </a></div>
In addition to the issue of carousel components can not be automatically played, here are a few questions to note:
1, the first part of attention is data-ride= "Carousel"
Using the bootstrap Carousel component by default, you can automatically play it by adding data-ride= "Carousel". You do not need to use the initialized JS function. So, if Carousel doesn't play automatically, check this section first. Other parameters can be added here, such as the time interval to set the rotation of the image.
Code: <div id= "Mycarousel" class= "Carousel Slide" data-ride= "Carousel " data-interval= ">"
2, in fact, there are manual initialization of the Carousel component method
This method is used in bootstrap 2.x, when the data-ride= "Carousel" method is used, it can be initialized manually. The code is as follows:
$ (' #myCarousel '). Carousel ();
If you still want to control the time interval for the rotation of the image, there are parameters:
$ (function () { $ (' #myCarousel '). Carousel ({ interval:3000 });});
If the settings do not play automatically, you can also:
$ (' #myCarousel '). Carousel ({ pause:true, interval:false});
Reference:
Http://www.runoob.com/bootstrap/bootstrap-carousel-plugin.html
The Carousel of Bootstrap