Hover only on non-transparent part of image

前端 未结 6 672
野性不改
野性不改 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:49

    ImageMapster looks to be a good easy way to get image area maps working cross browser (IE6+, requires jQuery).

    Another option would be to use raphael.js which creates SVG vector images that are translated to work in everything from IE6 upwards (everything except the stock browser in some old Android phones, I believe). They can be controlled using javascript in all sorts of ways and can have all the standard events e.g. mouseover, click, etc.

    Raphael works better here than the Flash option in that it doesn't rely on Flash. It's less simple than the area map option and has a steep learning curve, but, for complex cases and dynamically changing shapes, it brings the additional benefit of a wide range of ways to control the vector images you create.

提交回复
热议问题