Bootstrap实现基于carousel.js框架的轮播图效果

冬天地上扑的是雪,厚厚的,软软的;房上落的是雪,白皑皑的,又松又软;树上盖的是雪,积雪把树枝压弯了腰。太阳照在雪山上,发出耀眼的光芒。

本文实例为大家分享了Bootstrap轮播图效果展示的具体代码,供大家参考,具体内容如下

声明式触发需要使用到的几个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 rel="shorticon" type="image/x-icon" rel="nofollow noopener noreferrer" href="Images/webicon.ico" rel="external nofollow" rel="external nofollow" />
  <link rel="icon" type='image/x-icon' rel="nofollow noopener noreferrer" href="Images/webicon.ico" rel="external nofollow" rel="external nofollow" />

  <!--Bootstrap CSS Link-->
  <link rel="stylesheet" rel="nofollow noopener noreferrer" href="bootstrap/css/bootstrap.min.css" rel="external nofollow" />
  <link rel="stylesheet" rel="nofollow noopener noreferrer" href="bootstrap/css/bootstrap-theme.css" rel="external nofollow" />

  <!-- Bootstrap JS and JQuery JS Link -->
  <script src="JS/jquery.min.js"></script>
  <script src="bootstrap/js/bootstrap.min.js"></script>

 </head>
 <body>
  <!-- 制作巨幕轮播图 -->
  <div class="carousel" id="carouselcontainer" data-ride="carousel" style="background-color: rgba(128, 128, 128, 0.42);margin-top: 10%;width: 100%;height:658px;">
   <ol class="carousel-indicators">
    <li class="active" 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 class="carousel-inner">
    <div class="item active">
     <a rel="nofollow noopener noreferrer" href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
      <img src="Images/1.png" title="巨幕轮播图1" style="width: 100%;height: 658px;" />
     </a>
    </div>
    <div class="item">
     <a rel="nofollow noopener noreferrer" href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
      <img src="Images/1.jpg" title="巨幕轮播图2" style="width: 100%;height: 658px;" />
     </a>
    </div>
    <div class="item">
     <a rel="nofollow noopener noreferrer" href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
      <img src="Images/2.jpg" title="巨幕轮播图3" style="width: 100%;height: 600px;" />
     </a>
    </div>
    <div class="item">
     <a rel="nofollow noopener noreferrer" href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
      <img src="Images/3.jpg" title="巨幕轮播图4" style="width: 100%;height: 600px;" />
     </a>
    </div>
   </div>
   <div class="left carousel-control" rel="nofollow noopener noreferrer" href="#carouselcontainer" rel="external nofollow" rel="external nofollow" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left"></span>
   </div>
   <div class="right carousel-control" rel="nofollow noopener noreferrer" href="#carouselcontainer" rel="external nofollow" rel="external nofollow" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right"></span>
   </div>
  </div>
 </body>
</html>

以上就是Bootstrap实现基于carousel.js框架的轮播图效果。冲刺这一年,我志憾天地。用信念战胜困难,用效率战胜惰性,用常规战胜浮躁。激情似火,心静如水。全力拼搏每一天,专注高效每一节,聚精会神每一分。付出非常之努力,收获非常之进步。冲刺这一年,决胜这一生;冲刺这一年,幸福八十年;冲刺这一年,全家尽欢颜!更多关于Bootstrap实现基于carousel.js框架的轮播图效果请关注haodaima.com其它相关文章!

您可能有感兴趣的文章
jQuery幻灯片插件owlcarousel参数说明中文文档

Bootstrap的Carousel配合dropload.js实现移动端滑动切换图片

Bootstrap 轮播(Carousel)插件

利用BootStrap的Carousel.js实现轮播图动画效果

bootstrap select2 动态从后台Ajax动态获取数据的代码