guest00534&45x$5x: Mouseover

Beitrag lesen

Homeinaktiv = new Image; Homeinaktiv.src = "Home1.gif";
Homeaktiv = new Image; Homeaktiv.src = "Homehell.gif";

function MouseOverRoutine('Homebutton')

In den Klammern kommen nur Variablen also ohne ''! sonst wäre es ein string

{
if (Homebutton=="Home")

wozu diese Abfrage??? weg damit!

{document.Home.src = Homeaktiv.src;}
}

function MouseOutRoutine('Homebutton')
{
if (Homebutton=="Home")
{document.Home.src = Homeinaktiv.src;}
}

</script>
<a href="index.htm" onmouseover="MouseOverRoutine('Homebutton')" onmouseout="MouseOutRoutine('Homebutton')">

<img border="0" src="Home1.gif" name="Home" width="144" height="163"></a></p>

Also im großen und ganzen: lass einfach die if-schleife weg:

function MouseOverRoutine() {
  document.Home.src = Homeaktiv.src;
}
function MouseOutRoutine() {
  document.Home.src = Homeinaktiv.src;
}

und:

<a href="index.htm" onmouseover="MouseOverRoutine()" onmouseout="MouseOutRoutine()">
<img border="0" src="Home1.gif" name="Home" width="144" height="163"></a></p>

fertig!