Home > DeveloperSection > Interviews > how to get the scroll height and width in javascript?

Posted on    January-01-2011 12:00 AM

 JavaScript JavaScript 
Ratings:
 1 Answer(s)
  1314  View(s)
Rate this:

Amit Singh

Total Post:565

Points:2825
Posted on    January-01-2011 1:00 AM

we get the scroll Width in javascript
Width : window.pageXOffset ||
document.body.scrollLeft ||
document.documentElement.scrollLeft;
we get the scroll Height in javascript
Height: window.pageYOffset ||
document.body.scrollTop ||
document.documentElement.scrollTop;

Don't want to miss updates? Please click the below button!

Follow MindStick