首页 > 编程语言 > 详细

BootStrap之JavaScript插件中的轮播图

时间:2020-04-05 17:37:13      阅读:54      评论:0      收藏:0      [点我收藏+]

先看效果:

技术分享图片

实现:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 轮播图 </title>
    <link href="./BootStrap_3.3.7_libs/css/bootstrap.min.css" rel="stylesheet">
    <script src="./jQuery/jquery-3.2.1.min.js"></script>
    <script src="./BootStrap_3.3.7_libs/js/bootstrap.min.js"></script>
</head>
<body>

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
    <!-- Indicators -->
    <ol class="carousel-indicators">
        <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
        <li data-target="#carousel-example-generic" data-slide-to="1"></li>
        <li data-target="#carousel-example-generic" data-slide-to="2"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">
        <div class="item active">
            <img src="./img/01.jpg" alt="...">
            <div class="carousel-caption">
                图片1
            </div>
        </div>
        <div class="item">
            <img src="./img/02.jpg" alt="...">
            <div class="carousel-caption">
                图片2
            </div>
        </div>
        <div class="item">
            <img src="./img/03.jpg" alt="...">
            <div class="carousel-caption">
                图片3
            </div>
        </div>
        <div class="item">
            <img src="./img/06.jpg" alt="...">
            <div class="carousel-caption">
                图片4
            </div>
        </div>
        ...
    </div>

    <!-- Controls -->
    <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
    </a>
    <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
</div>

</body>
</html>

 

详情请查看:BootStrap之JavaScript 插件

 

          

BootStrap之JavaScript插件中的轮播图

原文:https://www.cnblogs.com/liyihua/p/12412016.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!