Eftersom jag inte är någon hejare på Javascript har jag ett problem. Testa:Onmouseover
Jag har en Sverige karta indelad i tre zoner, i varje zon ska använda onmouseover och en länk.
Jag har provat fäljande kod.
<head>
<script type="text/javascript">
function mouseOver()
{
document.getElementById("b1").src="karta5.jpg"
}
function mouseOut()
{
document.getElementById("b1").src="karta4.jpg"
}
function mouseOver()
{
document.getElementById("b2").src="karta6.jpg"
}
function mouseOut()
{
document.getElementById("b2").src="karta4.jpg"
}
function mouseOver()
{
document.getElementById("b2").src="karta7.jpg"
}
function mouseOut()
{
document.getElementById("b2").src="karta4.jpg"
}
</script>
</head>
<body>
<th width="291" scope="col"><map name="FPMap0">
<area href="../../../karta/norra_sverige.htm" shape="rect" coords="19, 3, 141, 150" onMouseOver="mouseOver()"
onmouseout="mouseOut()" target="hoger" id="b1">
<area href="../../../karta/mellan_sverige.htm" shape="polygon" coords="7, 203, 89, 253, 109, 206, 86, 149, 6, 149" onmouseover="mouseOver()"
onmouseout="mouseOut()" target="hoger" id="b2">
<area href="../../../karta/sodra_sverige.htm" target="hoger" shape="polygon" coords="105, 251, 93, 251, 6, 204, 1, 311, 103, 313" onmouseover="mouseOver()" onmouseout="mouseOut()" target="hoger" id="b3></map>
<img border="0" src="karta4.jpg" width="146" height="320" usemap="#FPMap0" > </th>
</body>
Det funkar inte. Kan någon vänlig själ hjälpa mig ?Sv: Onmouseover
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Map</title>
</head>
<body>
<div>
<map id="FPMap0" name="FPMap0">
<area
alt="Norra sverige"
target="hoger"
href="../../../karta/norra_sverige.htm"
shape="rect"
coords="19, 3, 141, 150"
onmouseover="highlightNorth()"
onmouseout="restoreMap()" />
<area
alt="Mellan sverige"
target="hoger"
href="../../../karta/mellan_sverige.htm"
shape="poly"
coords="7, 203, 89, 253, 109, 206, 86, 149, 6, 149"
onmouseover="higlightMiddle()"
onmouseout="restoreMap()" />
<area
alt="Södra sverige"
target="hoger"
href="../../../karta/sodra_sverige.htm"
shape="poly"
coords="105, 251, 93, 251, 6, 204, 1, 311, 103, 313"
onmouseover="highlightSouth()"
onmouseout="restoreMap()" />
</map>
<img
id="map"
alt="Sverige"
border="0"
src="karta4.jpg"
width="146"
height="320"
usemap="#FPMap0" />
</div>
<script type="text/javascript">
function restoreMap()
{
document.getElementById("map").src="karta4.jpg"
}
function highlightNorth()
{
document.getElementById("map").src="karta5.jpg"
}
function higlightMiddle()
{
document.getElementById("map").src="karta6.jpg"
}
function highlightSouth()
{
document.getElementById("map").src="karta7.jpg"
}
</script>
</body>
</html>