Passing mouse clicks through an overlaying element

前端 未结 4 698
别跟我提以往
别跟我提以往 2020-11-29 04:33

Is it possible to pass mouse clicks through an overlaying element:

4条回答
  •  清歌不尽
    2020-11-29 04:35

    You could try to retrieve the mouse coordinates in your click event and then retrieve an element by hiding your overlay, use document.elementFromPoint(x, y) and then redisplay the overlay.

    See this SO question for more info about elementFromPoint:

    How do I find the DOM node that is at a given (X,Y) position? (Hit test)

提交回复
热议问题