日期:2014-05-16 浏览次数:20403 次
<style>
.list{
margin:100px;
width:210px;
height:210px;
position:relative;
overflow:hidden;
}
.list div{
border:1px solid #ccc;
width:200px;
height:200px;
background:#fff;
position: absolute;
}
</style>
<div class="list">
<div class="act" >1111 <a href="javascript:;" >next</a> </div>
<div>2222 <a href="javascript:;" >next</a> </div>
<div>333 <a href="javascript:;" >next</a> </div>
</div>
<script src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
<script>
$(function(){
var ds= $('.list div'),L=ds.length,ii=1;
$('.list a').click(function(){
var el=$(this).parent('div');
var n= $(ds[(el.index()+1)%L]) ;
n.css( {left: 100,zIndex:ii++} ).animate({left:0},400)
});
})
</script>