<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body{background:#57beb9;}
/* main */
#main{width:920px;height:430px;overflow:hidden;position:relative;margin:30px auto;}
#main .box{width:820px;height:430px;box-shadow:0px 0px 5px #ddd;margin:0px auto;overflow:hidden;position:relative;}
#main .box img{width:820px;height:430px;position:absolute;left:0px;top:0px;opacity:0;filter:alpha(opacity=0);}
#main .btnLeft{width:35px;height:57px;position:absolute;left:0px;top:185px;background:url(images/left_ar.png) no-repeat 0px 0px;}
#main .btnRight{width:35px;height:57px;position:absolute;right:0px;top:185px;background:url(images/right_ar.png) no-repeat 0px 0px;}
#main .page{width:132px;height:22px;position:absolute;bottom:15px;right:50px;}
#main .page a{display:inline-block;width:22px;height:22px;background:url(images/num_grey.png) no-repeat 0px 0px;margin:0px 11px;float:left;color:#FFF;text-decoration:none;text-align:center;}
#main .page a.active{background:url(images/num_red.png) no-repeat 0px 0px;}
</style>
</head>
<body>
<div id="main">
<a class="btnLeft" id="btnLeft" href="javascript:void(0);"></a>
<a class="btnRight" id="btnRight" href="javascript:void(0);"></a>
<div class="box">
<img style="opacity: 1;" src="images/intro1.jpg">
<img src="images/intro2.jpg" style="opacity: 0;">
<img src="images/intro3.jpg" style="opacity: 0;">
</div>
<div class="page">
<a class="active" href="javascript:void(0);">1</a>
<a href="javascript:void(0);" class="">2</a> <a href="javascript:void(0);" class="">3</a>
</div>
</div>
<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
<script type="text/javascript">
$(function(){
var aPage = $(‘#main .page a‘);
var aImg = $(‘#main .box img‘);
var iSize = aImg.size();
var index = 0;
var t;
$(‘#btnLeft‘).click(function(){
index--;
if(index<0){
index=iSize-1
}
change(index)
})
$(‘#btnRight‘).click(function(){
index++;
if(index>iSize-1){
index=0
}
change(index)
})
aPage.click(function(){
index = $(this).index();
change(index)
});
function change(index){
aPage.removeClass(‘active‘);
aPage.eq(index).addClass(‘active‘);
aImg.stop();
aImg.eq(index).siblings().animate({
opacity:0
},1000)
aImg.eq(index).animate({
opacity:1
},1000)
}
function autoshow() {
index=index+1;
if(index<=iSize-1){
change(index);
}else{
index=0;
change(index);
}
}
int=setInterval(autoshow,3000);
function clearInt() {
$(‘#btnLeft,#btnRight,.page a‘).mouseover(function() {
clearInterval(int);
})
}
function setInt() {
$(‘#btnLeft,#btnRight,.page a‘).mouseout(function() {
int=setInterval(autoshow,3000);
})
}
clearInt();
setInt();
})
</script>
</body>
</html>