下载和使用 bootstrap.js
或压缩版的 bootstrap.min.js
下载
jQuery使用
代码如下
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="bootstrap-3.3.7-dist\css\bootstrap.min.css">
<script src="js/jquery.min.js" ></script>
<script src="bootstrap-3.3.7-dist\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="imgs/2.png" width="100%" alt="...">
</div>
<div class="item">
<img src="imgs/3.png" width="100%" alt="...">
<div class="carousel-caption">
页面2
</div>
</div>
<div class="item">
<img src="imgs/4.png" width="100%" alt="...">
<div class="carousel-caption">
页面3
</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>