Well, you determine the time of the animation. You can execute setInterval at the appropriate time interval. Like that .
$(function() { $("#hello").animate({"height":600}, 10000); var percent = 0; var pointer = setInterval(function() { if (percent > 100) { clearInterval(pointer); return; } $("#Status").text(percent + "%"); percent++; }, 100); });
EDIT
I added code to clear the interval to the end. And updated the demo
EDIT
I updated Demo again. Here, the animate is responsible for stopping the interval. However, this is not brilliantly accurate.
Oybek source share