1 图片滑动显示
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="../css/bootstrap.css">
<link rel="stylesheet" href="../css/bootstrap-theme.css">
<script src="../js/jquery-3.2.1.js"></script>
<script src="../js/bootstrap.js"></script>
<style>
.container{
width: 70%;
height: 600px;
margin: auto;
}
</style>
<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" ></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
<li data-target="#carousel-example-generic" data-slide-to="4"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item container">
<!--设置显示图片的位置-->
<img class="img" src="../img/2.jpg">
<div class="carousel-caption">
</div>
</div>
<div class="item container">
<!--设置显示图片的位置-->
<img src="../img/3.jpg">
<div class="carousel-caption">
</div>
</div>
<div class="item container">
<!--设置显示图片的位置-->
<img src="../img/4.jpg">
<div class="carousel-caption">
</div>
</div>
<div class="item active container">
<!--设置显示图片的位置-->
<img src="../img/1.jpg">
<div class="carousel-caption">
</div>
</div>
<div class="item container">
<!--设置显示图片的位置-->
<img src="../img/5.jpg">
<div class="carousel-caption">
</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>
显示效果:
未完待续。。。