Not sure exactly what you mean by that. If you want to find out what
percentage of the page's height is visible, the clientHeight and
scrollHeight properties of the body (documentElement in standards
mode) element will be of interest.
Actually my aim to find the scroll percentage in IE. To be more clear,
if i move the scroll bar from page top to page bottom, i should get
100% scroll. If i move scroll bar from page top to page middle, i
should get 50%. I use the code below
var docElem = document.documentElement;
var scrollHeight = docElem.scrollHeight;
var vScrollDiff = docElem.scrollTop - lastScrollTop; //assume i save
the last scroll top position
var vScrollPercentage = (Math.abs(vScrollDiff )/scrollHeight) * 100;
But the problem is the 'vScrollPercentage' never comes to 100% even if
scroll down to page bottom since
scrollHeight = scrollTop + 'height of vertical scroll bar' (assuming
scroll bar hit page bottom).
So if i can find height of vertical scroll bar, i would modify the
last line as
var vScrollPercentage = ( (Math.abs(vScrollDiff) +
scrollBarHeight) / scrollHeight) * 100;
Could any one help me on this ?
Thanks
Kiran