Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Hover over visible part of PNG image

Is there a way for me to check if the mouse is over a visible part of a PNG image?

img1

Each section is it's own image with a transparent background like:

img2

So basically I want the opacity of each region to be 1 when it is hovered, and the opacity to be 0.5 when not hovering over it. Therefore the user can see which region is being hovered over.

Is there something like onmouseover if mouse position on image != transparent then...

like image 906
Friedpanseller Avatar asked Sep 27 '22 08:09

Friedpanseller


1 Answers

Have a look at http://www.w3schools.com/tags/tag_area.asp

You can take image and you will get cords for each poly by using some image tool like photoshop etc and you can handle each hover event for specific region in area tag for Image.

Simply its easy to use and to make clickable map.

like image 179
Mayur Patel Avatar answered Oct 04 '22 17:10

Mayur Patel