I’m trying to animate an image of a box by changing it’s position on mouseover.
I can get it to move once but I need to set it up so that it moves everytime someone mouses over the image. I want to make the users ‘chase’ the box around the screen.
Preferably the animation would loop so that a user can never catch the image ?
Here is an example of what I have so far, and below is my jQuery code:
$(document).ready(function() {
$('#img').mouseover(function() {
$(this).animate({
left: '500px'
});
});
});
Thanks a million!
Here is an example. It covers basics I guess.