Try the following:
JSFiddle http://jsfiddle.net/2YqH2/
You do not move the clouds back to the right. Inside the loop function, I added
$('#clouds').css({right:0});
and the cycle will continue from there. I also changed your animation to animate the "right" property, since you said you want the clouds to move from right to left.
Also, your javascript was not well formed. Make sure you close brackets and brackets! Here's the fixed javascript.
$(document).ready(function() { function loop() { $('#clouds').css({right:0}); $('#clouds').animate ({ right: '+=1400', }, 5000, 'linear', function() { loop(); }); } loop(); });
source share