I get different values from Prototype’s cumulativeOffset function in Internet Explorer 8 and Firefox 3.5 within a complex layout with several elements having paddings and margins.
This seems to be a known bug: Discussion
Does anybody know a prototype based or prototype compatible method of reliably determining the offset height of a statically positioned element?
Here’s a diagram from Kangax’s cheat sheet, who is one of the members of the Prototype DEV team.
alt text http://preview.moveable.com/JM/dev/prototype_cheatsheet_1.6.0.png
You could add the viewport offset and the scroll offsets, but I’m not sure of this will contain the same issue.
Most of the time I use this Quirksmode script for finding element positions: