效果展示:
CSS代码:
<style type="text/css">
#wrapper {
width: 500px;
height: 500px;
text-align: center;
margin: 50px auto;
}
#start {
margin-right: 250px;
}
</style>
HTML代码:
<div id="wrapper">
<img src="../imgCouple/1.jpg" id="img"><br><br>
<input type="button" value="开始轮播" id="start">
<input type="button" value="暂停轮播" id="pause">
</div>
JavaScript代码:
<script type="text/javascript">
var imgList = ["../imgCouple/1.jpg", "../imgCouple/2.jpg", "../imgCouple/3.jpg", "../imgCouple/4.jpg", "../imgCouple/5.jpg"];
va