日期:2014-05-16 浏览次数:20269 次
$(function() { var x = 0; var y = 0; var tt = setInterval(scrollImg, 10); function scrollImg() { var top = Math.abs(Math.sin(x)*50 + 100); var left = y; $(".holder").find('img').each(function() { var $this = $(this); $(this).css({"margin-top" : top + "px", "margin-left" : y + "px"}); y = y + 1; x = (0.03) * y + 2; }); if (y > 800) clearInterval(tt); } });