声明式触发需要使用到的几个data-*属性
1.data-ride:作用在最外层容器上,固定值:carousel
2.data-target:作用在class=carousel-indicators的每个子元素li上面,标注对那个元素进行点击轮播
3.data-slide:作用在前翻页和后翻页的两个a链接上,prev表示前翻页,next表示后翻页
4.data-slide-to:作用在class=carousel-indicators的每个子元素li上面,标注对应的li元素对应的图片动画帧的下标,从0开始
5.data-interval:轮番图自动轮播的等待时间,如果为false则不自动轮播,默认为5000ms
6.data-pause:指定鼠标停留在轮换图上是否停止轮播,离开后继续自动轮播
7.data-wrap:指定是否持续轮播
轮播图代码实现:
<!Doctype html> <html> <head> <title>登录界面-bootstrap打造前端--美观高大上-成兮制作</title> <!-- meta --> <meta http-equiv="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <!-- ICON Link --> <link type="image/x-icon" href="https://www.jb51.net/Images/webicon.ico" /> <link type='image/x-icon' href="https://www.jb51.net/Images/webicon.ico" /> <!--Bootstrap CSS Link--> <link href="https://www.jb51.net/bootstrap/css/bootstrap.min.css" /> <link href="https://www.jb51.net/bootstrap/css/bootstrap-theme.css" /> <!-- Bootstrap JS and JQuery JS Link --> <script src="https://www.jb51.net/JS/jquery.min.js"></script> <script src="https://www.jb51.net/bootstrap/js/bootstrap.min.js"></script> </head> <body> <!-- 制作巨幕轮播图 --> <div data-ride="carousel"> <ol> <li data-target="#carouselcontainer" data-slide-to="0"></li> <li data-target="#carouselcontainer" data-slide-to='1'></li> <li data-target="#carouselcontainer" data-slide-to="2"></li> <li data-target="#carouselcontainer" data-slide-to="3"></li> </ol> <div> <div> <a href="javascript:void(0);" > <img src="https://www.jb51.net/Images/1.png" title="巨幕轮播图1" /> </a> </div> <div> <a href="javascript:void(0);" > <img src="https://www.jb51.net/Images/1.jpg" title="巨幕轮播图2" /> </a> </div> <div> <a href="javascript:void(0);" > <img src="https://www.jb51.net/Images/2.jpg" title="巨幕轮播图3" /> </a> </div> <div> <a href="javascript:void(0);" > <img src="https://www.jb51.net/Images/3.jpg" title="巨幕轮播图4" /> </a> </div> </div> <div href="#carouselcontainer" data-slide="prev"> <span></span> </div> <div href="#carouselcontainer" data-slide="next"> <span></span> </div> </div> </body> </html>