I am trying to do positioning in JavaScript. I am using a cumulative position function based on the classic quirksmode function that sums offsetTop and o
I have made a test of 2,304 divs with unique combinations of values for position, display, and visibility, nested inside unique combinations of each of those values, and determined that:
an otherwise-valid element
that is a descendant of
will not have an offsetParent value if:
position:fixed (Webkit and IE9)display:none (Webkit and FF)display:none (Webkit and FF)It is also reasonable to expect that an element that has no parent, or that is not added to the page itself (is not a descendant of the of the page), will also have offsetParent==null.