举一个最常见的轮播图例子,五张轮播图 + 圆点指示器 + 左右箭头
<!-- 首先引入jQuery和unslider -->
<script src="jquery-1.11.1.min.js"></script>
<script src="unslider.min.js"></script>
<!-- 写点样式,让轮播好看点 -->
ul, ol { padding: 0;}
.banner { position: relative; overflow: auto; text-align: center;}
.banner li { list-style: none; }
.banner ul li { float: left; }
#b04 { width: 640px;}
#b04 .dots { position: absolute; left: 0; right: 0; bottom: 20px;}
#b04 .dots li
{
display: inline-block;
width: 10px;
height: 10px;
margin: 0 4px;
text-indent: -999em;
border: 2px solid #fff;
border-radius: 6px;
cursor: pointer;
opacity: .4;
-webkit-transition: background .5s, opacity .5s;
-moz-transition: background .5s, opacity .5s;
transition: background .5s, opacity .5s;
}
#b04 .dots li.active