温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-09-10 10:50:32 来源:脚本之家 阅读:137 作者:成兮 栏目:web开发

本文实例为大家分享了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" href="Images/webicon.ico" rel="external nofollow" rel="external nofollow" />
  <link rel="icon" type='image/x-icon' href="Images/webicon.ico" rel="external nofollow" rel="external nofollow" />

  <!--Bootstrap CSS Link-->
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" rel="external nofollow" />
  <link rel="stylesheet" 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" >
   <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 href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
      <img src="Images/1.png" title="巨幕轮播图1"  />
     </a>
    </div>
    <div class="item">
     <a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
      <img src="Images/1.jpg" title="巨幕轮播图2"  />
     </a>
    </div>
    <div class="item">
     <a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
      <img src="Images/2.jpg" title="巨幕轮播图3"  />
     </a>
    </div>
    <div class="item">
     <a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
      <img src="Images/3.jpg" title="巨幕轮播图4"  />
     </a>
    </div>
   </div>
   <div class="left carousel-control" href="#carouselcontainer" rel="external nofollow" rel="external nofollow" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left"></span>
   </div>
   <div class="right carousel-control" href="#carouselcontainer" rel="external nofollow" rel="external nofollow" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right"></span>
   </div>
  </div>
 </body>
</html>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持亿速云。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI