Bootstrap chain usel, bootstrapchain usel
The Bootstrap Carousel plug-in is a flexible and responsive way to add a slider to a site. In addition, the content is flexible enough, including images, embedded frames, videos, and any other types of content you want to place.
If you want to independently reference the functions of this plug-in, you need to referenceCarousel. js. Alternatively, you can referenceBootstrap. jsOr compressed versionBootstrap. min. js.
The following is a simple slide. The Bootstrap Carousel plug-in shows a general component of the loop playback element. To implement carousel, you only need to add the Code with this flag. You do not need to use the data attribute. You only need to perform simple class-based development.
<Div id = "myCarousel" class = "carousel slide"> <! -- Carousel) indicator --> <ol class = "carousel-indicators"> <li data-target = "# myCarousel" data-slide-to = "0" class = "active"> </ li> <li data-target = "# mydomainusel" data-slide-to = "1"> </li> <li data-target = "# mydomainusel" data-slide- to = "2"> </li> </ol> <! -- Carousel) project --> <div class = "carousel-inner"> <div class = "item active"> </div> <div class = "item"> </div> <div class = "item"> </div> </div> <! -- Carousel navigation --> <a class = "usel-control left" href = "# myeclipusel" data-slide = "prev"> & lsaquo; </a> <a class = "carousel-control right" href = "# myeclipusel" data-slide = "next"> & rsaquo; </a> </div>
In addition, you should pay attention to the following issues about the problem that the Carousel component cannot be automatically played:
1. The first thing to note is data-ride = "carousel"
By default, Bootstrap's movie usel component is used. You only need to add data-ride = "movie usel" to enable automatic playback. You do not need to use initialization js functions. Therefore, if carousel does not play the video automatically, check this part first. Other parameters can be added here, such as setting the image rotation interval.
Code: <div id = "myCarousel" class = "carousel slide"Data-ride = "carousel" Data-interval = "2000">
2. You can also manually initialize the carousel component.
This method is used in Bootstrap 2.x. When the data-ride = "carousel" method is not used, you can manually initialize it. The Code is as follows:
$('#myCarousel').carousel();
If you want to control the image rotation interval, you can also set the following parameters:
$(function(){ $('#myCarousel').carousel({ interval: 3000 });});
If you do not set automatic playback, you can also:
$('#myCarousel').carousel({ pause: true, interval: false});
Refer:
Http://www.runoob.com/bootstrap/bootstrap-carousel-plugin.html