find elements that are stacked under (visually) an element in jquery

前端 未结 4 2080
小鲜肉
小鲜肉 2020-11-29 09:37

if i have 2 divs (z index is not assigned), one layered over the over, can i use the reference to the top div to find which div is below it?

as far as the DOM struct

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 10:07

    As far as I know, there isn't a selector for this. You could probably write a function to do this though. I would iterate over each element that precedes the div in question and check whether or not it's bounding box is in the desired div.

提交回复
热议问题