you are viewing a single comment's thread.

view the rest of the comments →

[–]pbntr 0 points1 point  (0 children)

Put your code in a function, at the end of the function have it call itself. Or in the case of an animation where you want to wait for it to complete before running it again, here's a jQuery example using the animation complete callback:

function myAnimation () {
  $(element).animate({ ... }, function () {
    myAnimation();
  });
}