
 代码如下:  
here  script>    
1 
2 
3 
4 
5 
6 
7 
8 
9 
10      
1 
2 
3 
4 
5 
6 
7 
8 
9 
10      
$(document).ready(function(){ 
var speed = 1000; 
var div_width = $("#list > div:first").width() + parseInt($("#list > div:first").css("margin-left")) + parseInt($("#list > div:first").css("margin-right")); 
var offset = 220; 
$(".button").click(function(){ 
id = $(this).attr("id").replace("button",""); 
var _length = -(id - 1) * div_width - offset; 
$("#list").animate({left:_length + "px"},speed); 
}); 
}); 
 script>