The scrollHeight , scrollWidth , scrollLeft , and scrollTop PropertiesYou use the scrollHeight , scrollWidth , scrollLeft , and scrollTop properties with elements that can be scrolled, such as <BODY> and <TEXTAREA> elements. The scrollHeight and scrollWidth properties give the actual height and width of an object (no matter how much of the object is visible currently). The scrollLeft and scrollTop properties give the distance in pixels from the upper left of the scrolling area to the upper left of the object you're scrolling. You can see the support for these properties in Table 5.51. Table 5.51. The scrollHeight , scrollWidth , scrollLeft , and scrollTop Properties
Tip In Internet Explorer, only a few objects supported this property; now almost all do. If the object doesn't actually support scrolling, however, these properties will always have a value of 0. |