TOC PREV NEXT INDEX

domref



offsetTop


offsetTop returns the position of the current element relative to the top of the offsetParent node.

Syntax

topPos = element.offsetTop
 

Parameters

topPos is the number of pixels from the top of the parent element.

Example

d = document.getElementById("div1");
 
topPos = d.offsetTop;
 
if (topPos > 10 ) {
 
    // object it offset less
 
    // than 10 pixels in its parent
 
}
 

Notes

None.

Specification

DOM Level 0. Not part of specification.


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX