Bootstrap plug-in-carousel image, bootstrap-carousel usel
<! DOCTYPE html>
The above uses declarative methods to achieve carousel
The declarative method is implemented by defining the data attribute, which can easily control the carousel position. It mainly includes the following types:
- Data-ride attribute: The value is usel and is defined on usel.
- Data-target attribute: The value is the ID defined by usel or another style identifier, as shown in the previous example. The value is "# slidershow ", and define it on each li of the carousel counter.
- Data-slide attributes: values include prev, next, and prev, which indicate backward scrolling, and next, which indicates forward scrolling. The property value is also defined on the link of the carousel controller, And the href value of the controller is set to the ID of container carousel usel or another style identifier.
- Data-slide-to attribute: used to pass the subscript of a frame. For example, data-slide-to = "2" can be directly redirected to the specified frame (the subscript starts from 0 ), it is also defined on each li of the carousel counter.
If the data-ride attribute is not defined, you can use the JavaScript method to trigger the carousel image switching:
<! DOCTYPE html>