How about this?
The animate method is synchronous so there’s no need to use the callback functions. Only with the last animation – to loop to the start again. Looking at it, I think you wanna make sure the random subtraction doesn’t make the element ‘disappear’. But that’s another subject. It would probably not be too difficult to do with CSS either (but I am admittedly more into this stuff). I could also imagine some other tweaks, like using an array for the values so not all the parameters have to be passed through the
Post was obviously edited…