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?
Thanks
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?
Thanks
Not sure i've understood the exact animation you requested but, anyway, Try this:
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
function moveRight(){
$("#b").animate({left: "+=300"}, 2000,moveLeft)
}
function moveLeft(){
$("#b").animate({left: "-=300"}, 2000,moveRight)
}
$(document).ready(function() {
moveRight();
});
Use jquery spritely to get your image moving from left to right in a continouse pattern. Download the plugin, attach it your page and look at their demos to get an idea. I've used something like this in the past to move my items with spritely..
$('#trees').pan({fps: 30, speed: 2, dir: 'left'});