gadj
01-06-2007, 12:17 PM
Hi
First post, so sorry for asking a question first, but I'm totally stuck on this.
I'm creating a web site for a spa bath company, and part of it is a map of europe where you hover over countries and they light up. You can click on a country and it stays lit. To this end, I've used a map of europe which contains an html map with multiple areas for each country. When you hover over the area, the country lights up (a previously invisible image of the country then appears above the map).
My problem is, and maybe its the technique I've used to code it, that when the image appears on top of the map (the lit country), if any of the map areas fall within the rectangle of the now visible image, they don't register. I'm assuming this is a z-index problem, but I've tried setting the z-index of the img of the europe map to higher than the images that appear on top, but this made no difference. tbh, wouldn't have worked if it did because then the country would appear below the europe map.
I think I need the html map areas of the base europe map to be a higher z-index than the image of the country that appears, but I can't work out how to do this. Setting a style of z-index to the map area has no effect - guess it doesn't support it.
Here is a sample of the html, I can supply the JS if needed, but I think its more the HTML that is the problem. In this particular example, when the france img becomes visible, because its been clicked on, the hover over of the belgium map does not register:
<map name='francemap'>
<area alt='France' onmouseout='HideCounty("france");' shape='poly' coords='62,2,87,27,99,33,94,41,94,47,90,47,78,59,78,66,86,67,86,74,84,76,85,90,89,94,85,94,75,99,69,94,58,92,46,97,46,105,33,98,23,98,12,87,22,59,22,48,17,46,17 ,36,2,23,4,19,11,19,13,23,22,25,26,24,26,14,34,19,42,19,43,16,51,13,56,7,57,1' />
</map>
<img border='0' alt='France' usemap='#francemap' onclick='ActivateCounty("france");' id="france" src='images/france-textured.png' style='visibility:hidden;position:absolute;top:554;left:571;z-index:1' />
<map name='belgiummap'>
<area alt='Belgium & Luxembourg' onmouseout='HideCounty("belgium");' shape='poly' coords='0,1,16,1,20,7,20,13,22,20,22,24,19,21,17,21,0,4' />
</map>
<img border='0' alt='Belgium & Luxembourg' usemap='#belgiummap' onclick='ActivateCounty("belgium");' id="belgium" src='images/belgium-textured.png' style='visibility:hidden;position:absolute;top:551;left:638;' />
<map name='europemap'>
<area alt='France' onmouseover='ShowCounty("france");' shape='poly' coords='144,245,169,270,181,276,176,284,176,290,172,290,160,302,160,309,168,310,168,317,166,319,167,333,171,337,167,337,157,342,151,337,140,335,128,340,128,348, 115,341,105,341,94,330,104,302,104,291,99,289,99,279,84,266,86,262,93,262,95,266,104,268,108,267,108,257,116,262,124,262,125,259,133,256,138,250,139,244' />
<area alt='Belgium & Luxembourg' onmouseover='ShowCounty("belgium");' shape='poly' coords='150,243,166,243,170,249,170,255,172,262,172,266,169,263,167,263,150,246' />
</map>
<table ID="Table1">
<tr>
<td style='width:628px'>
<div style='width:452px' id='stockistscontent'> </div>
</td>
<td style='text-align:right;'>
<img id='europemap' border='0' src='images/europe-map-grey.jpg' usemap='#europemap' style='z-index:100' /><br>
</td>
</tr>
</table>
Any help would be very gratefully received.
First post, so sorry for asking a question first, but I'm totally stuck on this.
I'm creating a web site for a spa bath company, and part of it is a map of europe where you hover over countries and they light up. You can click on a country and it stays lit. To this end, I've used a map of europe which contains an html map with multiple areas for each country. When you hover over the area, the country lights up (a previously invisible image of the country then appears above the map).
My problem is, and maybe its the technique I've used to code it, that when the image appears on top of the map (the lit country), if any of the map areas fall within the rectangle of the now visible image, they don't register. I'm assuming this is a z-index problem, but I've tried setting the z-index of the img of the europe map to higher than the images that appear on top, but this made no difference. tbh, wouldn't have worked if it did because then the country would appear below the europe map.
I think I need the html map areas of the base europe map to be a higher z-index than the image of the country that appears, but I can't work out how to do this. Setting a style of z-index to the map area has no effect - guess it doesn't support it.
Here is a sample of the html, I can supply the JS if needed, but I think its more the HTML that is the problem. In this particular example, when the france img becomes visible, because its been clicked on, the hover over of the belgium map does not register:
<map name='francemap'>
<area alt='France' onmouseout='HideCounty("france");' shape='poly' coords='62,2,87,27,99,33,94,41,94,47,90,47,78,59,78,66,86,67,86,74,84,76,85,90,89,94,85,94,75,99,69,94,58,92,46,97,46,105,33,98,23,98,12,87,22,59,22,48,17,46,17 ,36,2,23,4,19,11,19,13,23,22,25,26,24,26,14,34,19,42,19,43,16,51,13,56,7,57,1' />
</map>
<img border='0' alt='France' usemap='#francemap' onclick='ActivateCounty("france");' id="france" src='images/france-textured.png' style='visibility:hidden;position:absolute;top:554;left:571;z-index:1' />
<map name='belgiummap'>
<area alt='Belgium & Luxembourg' onmouseout='HideCounty("belgium");' shape='poly' coords='0,1,16,1,20,7,20,13,22,20,22,24,19,21,17,21,0,4' />
</map>
<img border='0' alt='Belgium & Luxembourg' usemap='#belgiummap' onclick='ActivateCounty("belgium");' id="belgium" src='images/belgium-textured.png' style='visibility:hidden;position:absolute;top:551;left:638;' />
<map name='europemap'>
<area alt='France' onmouseover='ShowCounty("france");' shape='poly' coords='144,245,169,270,181,276,176,284,176,290,172,290,160,302,160,309,168,310,168,317,166,319,167,333,171,337,167,337,157,342,151,337,140,335,128,340,128,348, 115,341,105,341,94,330,104,302,104,291,99,289,99,279,84,266,86,262,93,262,95,266,104,268,108,267,108,257,116,262,124,262,125,259,133,256,138,250,139,244' />
<area alt='Belgium & Luxembourg' onmouseover='ShowCounty("belgium");' shape='poly' coords='150,243,166,243,170,249,170,255,172,262,172,266,169,263,167,263,150,246' />
</map>
<table ID="Table1">
<tr>
<td style='width:628px'>
<div style='width:452px' id='stockistscontent'> </div>
</td>
<td style='text-align:right;'>
<img id='europemap' border='0' src='images/europe-map-grey.jpg' usemap='#europemap' style='z-index:100' /><br>
</td>
</tr>
</table>
Any help would be very gratefully received.