var timerId = setInterval(function(){ if(window.document.drops.isFinished()){ clearInterval(timerId); } },1000);