Can jQuery animate send scrollheight as it animates, or do I need to create a separate function, and if the latter, how will this function work?
http://jsfiddle.net/A2s9Q/
You can use the scroll handler to update the label.
$(document).scroll(function(){ $("#scrollHeight").html($(document).scrollTop()); });
http://jsfiddle.net/A2s9Q/7/
Use setTimeout:
setTimeout
(function updateScrollheight(){ if(animating){ $('#scrollHeight').html($(document).scrollTop()); setTimeout( updateScrollheight, 200 ); } })();
Here is the DEMO :
you can use the step parameter from .animate (properties, parameters) where tihs goes into the parameters array along with your other parameters
step: function( now, fx ){$('#scrollHeight').html(now)}