码迷,mamicode.com
首页 > Web开发 > 详细

【jQuery】 jQuery上下飘动效果

时间:2015-08-17 15:19:51      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:

jQuery实现图片上下飘动效果

function moveRocket() {
    $(".smallShip")
            //2000毫秒内top = top + 60;
            .animate({ ‘top‘: ‘+=60‘ }, 2000)
            //停顿100毫秒
            .delay(100)
            //2000好秒内top = top - 60,注意:之后每100毫秒执行一次本函数
            .animate({ ‘top‘: ‘-=60‘ }, 2000, function () {
                setTimeout(moveRocket, 100);
            });
};
moveRocket();

 

注意:之后每100毫秒执行一次本函数

 源:http://www.lanrenzhijia.com/pic/926.html

【jQuery】 jQuery上下飘动效果

标签:

原文地址:http://www.cnblogs.com/oiliu/p/4736554.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!