Newer versions of jQuery use requestAnimationFrame
callbacks to handle effects, and browsers do not handle them in hidden tabs.
In the meantime, your setInterval
events are still happening, which leads to an increase in the number of animations in the queue.
Instead of using setInterval
to schedule the animation, use the "end callback" of the last animation to start the next loop, if necessary setTimeout
.
function slides1() { ... $("table#agah1").animate({ "left": first1 }, "slow"); $("table#agah2").animate({ "left": first2 }, "slow", function() { setTimeout(slides1, 2000);
This will provide a close connection between the delay between sessions and the animation itself and avoid problems with setTimeout
lack of synchronization with the animation.
source share