TOC PREV NEXT INDEX

Put your logo here!


offsetTop


offsetTop returns the position of the current element relative to the top of the parent element.

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.


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX