z-index and javascript events

后端 未结 2 1953
别那么骄傲
别那么骄傲 2021-01-17 21:33

So I have a couple of divs overlaid on eachother with differing z-index values.

The default behaviour for browsers seems to be the event bound to the top-most z-inde

相关标签:
2条回答
  • 2021-01-17 22:13

    If you are using an javaScript framework event bubbling might be included. (ExtJS I know for sure has this kind of event feature.)

    0 讨论(0)
  • 2021-01-17 22:19

    The event doesn't actually occur on the element that is obscured by another unless the other element is contained in the first, then it will bubble up. The only way that I can think of to achieve what you want is to go through all of the potential elements and see if any of them contain the point at which the click occurred and trigger a click on that element (if it's not the current one).

    0 讨论(0)
提交回复
热议问题