bootstrap实现每隔5秒自动轮播效果
人气:0本文实例为大家分享了bootstrap轮播的具体代码,供大家参考,具体内容如下
<!DOCTYPE html> <html> <head> <title>轮播</title> <link rel="stylesheet" href="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"> <style> #circleContent{ width:150px; height:150px; } </style> <script src="https://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script> $(document).ready(function(){ $('#circleContent').carousel({interval:5000});//每隔5秒自动轮播 }); </script> </head> <body> <div id="circleContent" class="carousel slide"> <ol class="carousel-indicators"> <li data-target="#circleContent" data-slide-to="0" class="active"></li> <li data-target="#circleContent" data-slide-to="1"></li> <li data-target="#circleContent" data-slide-to="2"></li> </ol> <div class="carousel-inner"> <div class="item active"> <img src="images/circle1.png"> <div class="carousel-caption">IMG1</div> </div> <div class="item"> <img src="images/circle2.png"> <div class="carousel-caption">IMG2</div> </div> <div class="item"> <img src="images/circle3.png"> <div class="carousel-caption">IMG3</div> </div> </div> <a class="carousel-control left" href="#circleContent" data-slide="prevent">‹</a> <a class="carousel-control right" href="#circleContent" data-slide="next">›</a> </div> </body> </html>
如果大家还想深入学习,可以点击这里进行学习,再为大家附4个精彩的专题:
加载全部内容