Sönke: Event-Handler

Beitrag lesen

Hallo Sönke !

Schau mal hier nach:
<../../tedg.htm>
(ggf. musst Du aber noch was ändern)

Weiteres hierzu findest Du auch auf
http://www.internet-partner.de/webmaster/java-script/javascript.html (unter 'MausTricks')
oder http://www.webaid.de/js/index.shtml (aber dort must Du ein wenig suchen ;-)

Hoffe das hilft Dir weiter..

Gruss Pepe

Hi Pepe, Hi Antje

Danke für eure Antworten!!!
Ich habe nun versucht, die Event-Handler anzuwenden, doch komischerweise funzt nur einer der acht Buttontausche. Hier der Quelltext:

<html>
<head>
<title>Navigation2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="Javascript">
<!--
Normal1 = new Image();
Normal1.src = "but_leh1.jpg";
Highlight1 = new Image();
Highlight1.src = "but_leh2.jpg";

Normal2 = new Image();
Normal2.src = "but_bes1.jpg";
Highlight2 = new Image();
Highlight2.src = "but_bes2.jpg";

Normal3 = new Image();
Normal3.src = "but_npc1.jpg";
Highlight3 = new Image();
Highlight3.src = "but_npc2.jpg";

Normal4 = new Image();
Normal4.src = "but_rei1.jpg";
Highlight4 = new Image();
Highlight4.src = "but_rei2.jpg";

Normal5 = new Image();
Normal5.src = "but_art1.jpg";
Highlight5 = new Image();
Highlight5.src = "but_art2.jpg";

Normal6 = new Image();
Normal6.src = "but_aus1.jpg";
Highlight6 = new Image();
Highlight6.src = "but_aus2.jpg";

Normal7 = new Image();
Normal7.src = "but_tra1.jpg";
Highlight7 = new Image();
Highlight7.src = "but_tra2.jpg";

Normal8 = new Image();
Normal8.src = "but_div1.jpg";
Highlight8 = new Image();
Highlight8.src = "but_div2.jpg";

function Bildwechsel(Bildnr,Bildobjekt)
{
window.document.images[Bildnr].src = Bildobjekt.src;
}
//-->
</script>
</head>

<body bgcolor="#000000" background="../back1.jpg" style="background-attachment:fixed" text="#ffffff" link="#00ff00" vlink="#0000ff" alink="#ffff00">

<p><a href="ausruest.htm" target="Hauptframe" onmouseover="Bildwechsel(0,Highlight1)" onmouseout="Bildwechsel(0,Normal1)"><img src="but_leh1.jpg" border=0></a></p>
<p style="margin-top:-0.4cm"><a href="ausruest.htm" target="Hauptframe" onmouseover="Bildwechsel(1,Highlight2)" onmouseout="Bildwechsel(1,Normal2)"><img src="but_bes1.jpg" border=0></a></p>
<p style="margin-top:-0.4cm"><a href="ausruest.htm" target="Hauptframe" onmouseover="Bildwechsel(2,Highlight3)" onmouseout="Bildwechsel(2,Normal3)"><img src="but_npc1.jpg" border=0></a></p>
<p style="margin-top:-0.4cm"><a href="ausruest.htm" target="Hauptframe" onmouseover="Bildwechsel(3,Highlight4)" onmouseout="Bildwechsel(3,Normal4)"><img src="but_rei1.jpg" border=0></a></p>
<p style="margin-top:-0.4cm"><a href="ausruest.htm" target="Hauptframe" onmouseover="Bildwechsel(4,Highlight5)" onmouseout="Bildwechsel(4,Normal5)"><img src="but_art1.jpg" border=0></a></p>
<p style="margin-top:-0.4cm"><a href="ausruest.htm" target="Hauptframe" onmouseover="Bildwechsel(5,Highlight6)" onmouseout="Bildwechsel(5,Normal6)"><img src="but_aus1.jpg" border=0></a></p>
<p style="margin-top:-0.4cm"><a href="ausruest.htm" target="Hauptframe" onmouseover="Bildwechsel(6,Highlight7)" onmouseout="Bildwechsel(6,Normal7)"><img src="but_tra1.jpg" border=0></a></p>
<p style="margin-top:-0.4cm"><a href="ausruest.htm" target="Hauptframe" onmouseover="Bildwechsel(7,Highlight8)" onmouseout="Bildwechsel(7,Normal8)"><img src="but_div1.jpg" border=0></a></p>
</body>
</html>

Riesendank schonmal, wenn ihr euch bis hierhin durchgekämpft habt. Was könnte hier falsch sein??

Ciao

Sönke