需要添加jquery文件才可以调试 复制代码 代码如下: <BR>$(function(){ <BR>//alert($('#findclose').closest('div').attr('id')); <BR>var pic_length = $('#gd li').length; <BR>var n = 0; <BR>$('#toleft').click(function(){ <BR>if (!$('#gd').is(':animated') && n) <BR>{ <BR>$('#gd').animate({left:'+=120px'},500); <BR>n--; <BR>} <BR>}); <BR>$('#toright').click(function(){ <BR>if (!$('#gd').is(':animated') && pic_length > n+5) <BR>{ <BR>$('#gd').animate({left:'-=120px'},500); <BR>n++; <BR>} <BR>}); <BR>}) <BR> <BR>ul{ <BR>list-style:none; <BR>margin:0px; <BR>padding:0px; <BR>text-align:center; <BR>} <BR>#gd li { <BR>width:90px; <BR>height:80px; <BR>display:block; <BR>float:left; <BR>margin:9px 15px; <BR>} <BR>