I know about the :animated
selector, but currently am running into (what might be one of a few) performance issue for older IE's (go figure). I feel like it might potentially be the way I'm testing for ANY Page Animation.
Currently I'm looping through an interval, with the core test being $('*').is(':animated')
. This $('*')
is what i'm worried about... but since I don't know exaclty what the divs / etc are that are being animated below my plugin, I'm not sure how else to do it!
var testAnimationInterval = setInterval(function () {
if ( ! $('*').is(':animated') ) { // all done animating
clearInterval(testAnimationInterval);
animationsFinished(); // callback function
}
}, 300);
function animationsFinished() {
// do whatever
}
Has anyone found a better / different way of doing this? Especially when it comes to performance?