Bootstrap how to realize the automatic carousel of pictures? Bootstrap instance code to realize automatic carousel of pictures

Source: Internet
Author: User

Bootstrap picture Auto Carousel Effect Chart:

Code implementation:

<! DOCTYPE html>
<linkrel= "stylesheet" href= "Bootstrap.min.css"/>
<linkrel= "stylesheet" href= "Bootstrap-theme.min.css"/>
<scriptsrc= "Jquery.min.js" ></script>
<scriptsrc= "Bootstrap.min.js" ></script>
<style>
#div1 {width:600px; height:500px}
</style>
<body>
<divid= "Div1" >
<divid= "Carousel-example-generic" class= "Carousel Slide" data-ride= "Carousel" >
<!--indicators-->
<olclass= "Carousel-indicators" >
<lidata-target= "#carousel-example-generic" data-slide-to= "0" class= "active" ></li>
<lidata-target= "#carousel-example-generic" data-slide-to= "1" ></li>
<lidata-target= "#carousel-example-generic" data-slide-to= "2" ></li>
</ol>
<!--wrapper for slides-->
<divclass= "Carousel-inner" role= "ListBox" >
<divclass= "Item Active" >
</div>
<divclass= "Item" >
</div>
<divclass= "Item" >
</div>
</div>
<!--Controls-->
<aclass= "left Carousel-control" href= "#carousel-example-generic" role= "button" data-slide= "prev" >
<spanclass= "Glyphicon glyphicon-chevron-left" id= "Aaron1" ></span>
<spanclass= "Sr-only" >Previous</span>
</a>
<aclass= "Right Carousel-control" href= "#carousel-example-generic" role= "button" data-slide= "Next" >
<spanclass= "Glyphicon glyphicon-chevron-right" id= "Aaron2" ></span>
<spanclass= "Sr-only" >Next</span>
</a>
</div>
</div>
</body>

The above code can realize the DIV1 in the picture Automatic Carousel, the carousel time default 5000ms.

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.