I'm trying to do the following using JavaScript :
[What i have achieved already - hover working over the rectangle on left side of map
However, I need the area to be working for other things than squares & geometric objects. What is the best/easy way to execute it so you can select areas like on the below image?
Image with selections
Basically you can use area tag Like below :
<img src="planets.gif" width="145" height="126" alt="Planets"
usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun">
<area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
<area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
</map>
Here is the link : http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_areamap
So you can assign a ID to each area , and you can write hover , click codes for those in javascript.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With