Js event bubbling problem solving thank you

now there is such a layout
I use a div to cover a picture
I want to click on the div (red area) anywhere I want to pop up
, but only around can pop up
meaning do not want the event added to the picture how to solve

Mar.10,2021

has nothing to do with bubbling.
div add clicks to control the show and hide. of the picture in the
event


is a layout problem that can be blocked in the front by positioning


this can be solved with event traversal, which can be solved by adding a style to the img element pointer-events:none; .

your description does not match the html structure. According to your html structure, it is not that I use a div to cover a picture , but a div that contains img elements

.

about event traversal, take a look at the blog post I wrote earlier = > event traversal

Menu