continuous movement
I would like to recreate the truck moments in the above site , It is done in mootools. How would I code this, is there a jQuery plugin to do this
Here's an example of the following code.
This is relatively simple with jQuery using the position:absolute CSS property and the .animation()[DOCS] method callback. You will basically be animating the left CSS property over a period of time within a named function, then call that function in the animation callback when the animation is complete, like so:
var animateTruck = function () {
$('#truck').css('left','-50px')
.animate({'left':$(window).width()},
4000,
'linear',
function(){
animateTruck();
});
};
animateTruck();