I am paging an HTML page. In order to compute the page break offsets more efficiently, I was wondering if it is possible to get the element containing a certain coordinate offset from the beginning of the page.
Thanks a lot in advance for your help,
Cheers!
You could do something like:
or
since you said they’re all top level elements, the following should also work:
You can also
$(this).offset()to get the offsets. Using theoffsetTopproperty only gets the offset from the parent I believe. But it may not matter since they are all top level elements.