Hover only on non-transparent part of image

前端 未结 6 664
野性不改
野性不改 2020-12-07 02:25

Is there any way to make only a non-transparent portion of an image to trigger mouse-over event?

If the mouse travels to the transparent area, the mouse-out should b

6条回答
  •  旧巷少年郎
    2020-12-07 02:56

    You can use an image with the old-fashioned and tags. An area tag can trigger javascript mouse events (an example use is this jQuery plugin: jQuery maphilight).
    However, there is no good way to create the map dynamically - you'll have to do it manually, or call a server-side service to map it.

提交回复
热议问题