BootStrap之JavaScript插件中的轮播图
先看效果:
实现:
<!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 插件
本文来自博客园,作者:LeeHua,转载请注明原文链接:https://www.cnblogs.com/liyihua/p/12412016.html