88487901 2011-01-26
代码如下:
animate(params[, duration[, easing[, callback]]])
代码如下:
<script type="text/javascript"> $(function() { $li1 = $(".apply_nav .apply_array"); $window1 = $(".apply .apply_w"); $left1 = $(".apply .img_l"); $right1 = $(".apply .img_r"); $window1.css("width", $li1.length*166); var lc1 = 0; var rc1 = $li1.length-5; $left1.click(function() { if (lc1 < 1) { alert("已经是第一张图片"); return; } lc1--; rc1++; $window1.animate({left:'+=166px'}, 1000); }); $right1.click(function() { if (rc1 < 1) { alert("已经是最后一张图片"); return; } lc1++; rc1--; $window1.animate({left:'-=166px'}, 1000); }); }) </script>