jQuery连续地从左到右对图像进行动画处理? [英] jQuery to animate image from left to right continously?

查看:163
本文介绍了jQuery连续地从左到右对图像进行动画处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个云图像,我想使用jQuery对其进行动画处理.

I have got a cloud image and I want to animate it using jQuery.

我想将云图像从左向右连续移动. 有人可以帮我吗?

I want to move the cloud image from left to right continuously. Someone can help me with this?

谢谢

推荐答案

不确定我已经理解了您要求的确切动画,但是无论如何,请尝试以下操作:

Not sure i've understood the exact animation you requested but, anyway, Try this:

HTML PART

HTML PART

<img id="b" src="http://www.web-press.it/folder/servizi_cloud.jpg" id="b" style="position:absolute; top:50px"/>

JAVASCRIPT/JQUERY PART

JAVASCRIPT/JQUERY PART

function moveRight(){
    $("#b").animate({left: "+=300"}, 2000,moveLeft)
}

function moveLeft(){
    $("#b").animate({left: "-=300"}, 2000,moveRight)
}

$(document).ready(function() {

   moveRight();

});

http://jsfiddle.net/tTman/

这篇关于jQuery连续地从左到右对图像进行动画处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆