javascript how to get element that is currently not visible -
i want element not visible in window. there function document.getelementfrompoint(x,y)
, works in situation?
in particular case have 2 layers on page, droppable , main one. have particular droppable div, save droppable div in variable, scroll down, droppable div stops being visible. @ moment want able top element on droppable div position.
to find element off top of view port: iterate through elements until find 1 el.getboundingclientrect().bottom
negative (see mdn).
a more general solution apply multiple criteria including off side or bottom comparing results size of view port (eg. bounding rectangle's top
being greater client size of window).
Comments
Post a Comment