Bootstrap chain usel, bootstrapchain usel

Source: Internet
Author: User
Tags bootstrap carousel

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.