How does jQuery accomplish its asynchronous animations?
animation, asynchronous, javascript, jquery
Solution
There is an alternative to setTimeout() called setInterval() which will call the function you pass as argument at regular intervals. Calling setInterval will return a value which can be passed to clearInterval to stop the function from being called.
Problem
...or more specifically, how are they able to create animations via javascript, which is synchronous, without holding up the next javascript statement. It's just a curiosity. Are they using a chain of `setTimeout()`? If so, are they set early, each one with a slightly longer duration than the previous, and running parallel? Or are they being created through a recursive function call, therefore running in series? Or is it something completely different?