OnMouseOver - Variante 3

Ergebnis:

Script:

<html><head>
<title>Javascript</title>
<script>
<!--
if (document.images)
{
var daisbacha = new Image()
daisbacha.src = "bilder/daisbach_a.gif"
var daisbachb = new Image()
daisbachb.src = "bilder/daisbach_b.gif"

var mannheima = new Image()
mannheima.src = "bilder/mannheim_a.gif"
var mannheimb = new Image()
mannheimb.src = "bilder/mannheim_b.gif"

var tonlinea = new Image()
tonlinea.src = "bilder/tonline_a.gif"
var tonlineb = new Image()
tonlineb.src = "bilder/tonline_b.gif"
}

function inact(imgName)
{
if (document.images)
document[imgName].src = eval(imgName + 'a.src')
}

function act(imgName)
{
if (document.images)
document[imgName].src = eval(imgName + 'b.src')
}

//-->
</script>

</head>
<body>

<a href="www.daisbach.de" onmouseover="act('daisbach')" onmouseout="inact('daisbach')">
<img name="daisbach" src="bilder/daisbach_a.gif" border="0" width="200" height="40"></a>
<a href="www.mannheim.de" onmouseover="act('mannheim')" onmouseout="inact('mannheim')">
<img name="mannheim" src="bilder/mannheim_a.gif" border="0" width="200" height="40"></a>
<<a href="www.t-online.de" onmouseover="act('tonline')" onmouseout="inact('tonline')">
<img name="tonline" src="bilder/tonline_a.gif" border="0" width="200" height="40"></a>

</body></html>