Javascript Reference
Categories: TEXTAREA

javascript TEXTAREA scrollLeft, scrollTop

@July 11, 2008, 2 p.m.
scrollLeft, scrollTop Firefox/Netscape/NN 7 IE 4 Chrome/Safari/DOM n/a  
Read/Write  

Provide the distance in pixels between the actual left or top edge of the TEXTAREA element's physical content and the left or top edge of the visible portion of the TEXTAREA content. Setting these properties allows you to use a script to adjust the scrolling of content within a scrollable container, such as text in a textarea element or an entire document in the browser window or frame. When the content is not scrolled, both values are zero. Setting the scrollTop property to 15 scrolls the document upward by 15 pixels in the window; the scrollLeft property is unaffected unless explicitly changed. The property values change as the user adjusts the scrollbars. This is important for some event-driven positioning tasks in IE for Windows because the coordinate system for event offset measurements are with respect to the visible area of a page in the browser window. You must add document.body scrolling factors to align event coordinates with body content positions . Starting with IE 5 for Windows, the scrollLeft and scrollTop properties are available for all HTML element objects, but values for unscrollable elements are zero.

 
Example
 
document.body.scrollTop = 40;
 
Value

Positive integer or zero.

 
Default

0

To the gakaa.com owner, Your posts are always well-supported by facts and figures.
Elisha Weeks - 6 days
Thank You
S - 2010-12-02

Powered by Linode.