Click through PNG image - only if clicked coordinate is transparent

前端 未结 2 579
遇见更好的自我
遇见更好的自我 2021-01-04 06:38

I have an image like this:

I want it so that when I click the transparent parts, the click should go through to the underlying element, but when I click a n

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 07:03

    For your scenario, would it be sufficient to capture click events on the non-transparent area of the image?

    This can be done using a map and some JavaScript:

    
    
    
    

    (The coordinates were derived using this site.)

提交回复
热议问题