dynamische Button highlights funktionieren nicht richtig
McRay1988
- javascript
Hallo,
ich habe ein Problem mit meinen "Buttons". Der erste funktioniert aber der nächste nicht. Anstadt das er sich highlighted öffnet er sich nochmal unter dem Bild was gehighlighted werden soll.
Im offline betrieb kommt eine Internetexplorer-Scriptfehler Fehlermeldung:
Zeile: 19
Zeichen: 2
Fhler: 'window.document.images[...]' ist Null oder kein Objekt
das habe ich aber auch schon überprüft. Kann mir vielleicht einr Helfen??
Hier mein Quellcode:
<html>
<head>
<title>Projektindex</title>
</head>
<script type="text/javascript">
<!--
Normal1 = new Image();
Normal1.src = "Btn_grey_dfl.gif";
Highlight1 = new Image();
Highlight1.src = "Btn_dia.gif";
Norma2 = new Image();
Norma2.src = "Btn_grey_dfl.gif";
Highlight2 = new Image();
Highlight2.src = "Btn_bf.gif";
function Bildwechsel(Bildnr,Bildobjekt) {
window.document.images[Bildnr].src = Bildobjekt.src;
}
//-->
</script>
<body bgcolor="#000000" link="#000000" vlink="#000000">
<div align="center" valign="center">
<map name="FPMap0">
<area href="blank1.html" shape="polygon" coords="226, 88, 265, 85, 267, 71, 277, 66, 300, 56, 319, 50, 329, 30, 345, 49, 370, 28, 367, 64, 403, 21, 409, 55, 362, 117, 383, 132, 361, 130, 343, 124, 339, 135, 348, 142, 370, 152, 396, 169, 404, 184, 400, 202, 408, 222, 426, 233, 442, 224, 466, 238, 492, 240, 487, 257, 476, 284, 448, 276, 426, 292, 384, 283, 347, 268, 332, 247, 310, 250, 286, 262, 271, 290, 255, 317, 208, 304, 198, 268, 174, 228, 156, 201, 165, 251, 148, 250, 104, 189, 73, 208, 59, 242, 38, 232, 75, 286, 20, 282, 0, 199, 6, 154, 43, 146, 36, 121, 63, 117, 85, 133, 113, 87, 108, 71, 134, 81, 119, 23, 144, 34, 157, 59, 149, 17, 173, 16, 201, 62, 208, 73, 241, 29, 257, 23, 261, 40" onMouseOver="Bildwechsel(0,Highlight1)" onMouseOut="Bildwechsel(0,Normal1)">
<area href="blank1.html" shape="polygon" coords="425, 149, 453, 149, 463, 157, 450, 139, 452, 132, 470, 141, 488, 148, 498, 162, 502, 180, 499, 199, 476, 190, 473, 177" onMouseOver="Bildwechsel(0,Highlight1)" onMouseOut="Bildwechsel(0,Normal1)">
<area href="blank2.html" shape="polygon" coords="522, 152, 511, 157, 512, 174, 511, 188, 507, 201, 494, 203, 482, 196, 474, 188, 469, 179, 446, 168, 437, 167, 385, 141, 359, 132, 348, 128, 350, 136, 376, 148, 396, 162, 407, 172, 412, 180, 420, 180, 439, 208, 453, 223, 460, 228, 476, 232, 494, 232, 506, 232, 502, 251, 502, 267, 501, 285, 450, 313, 435, 325, 432, 337, 438, 352, 457, 360, 494, 368, 489, 377, 481, 394, 494, 399, 510, 395, 528, 384, 519, 364, 545, 363, 552, 356, 563, 356, 555, 371, 580, 372, 594, 341, 588, 330, 566, 330, 555, 324, 564, 295, 570, 283, 599, 280, 599, 236, 587, 218, 577, 194, 558, 183, 563, 172, 556, 152, 539, 144" onMouseOver="Bildwechsel(1,Highlight2)" onMouseOut="Bildwechsel(1,Normal2)">
</map>
<img border="0" src="Btn_grey_dfl.gif" usemap="#FPMap0" width="600" height="400"></p>
<div>
</body>
</html>
und hier die Internetadresse: http://de.geocities.com/mcray1988
Danke
hallo McRay1988
ich finde kein zweites image ...
gute nacht
qp
Hallo,
ja es ist weg aber das problem leider noch nicht. Wenn man über den Soldat geht wird er nicht wie der Drache farbig sondern bleibt schwarz-weiß.
Danke
Normal1 = new Image();
Normal1.src = "Btn_grey_dfl.gif";
Highlight1 = new Image();
Highlight1.src = "Btn_dia.gif";Norma2 = new Image();
Norma2.src = "Btn_grey_dfl.gif";
Highlight2 = new Image();
Highlight2.src = "Btn_bf.gif";
Fällt Dir da NIX auf??!
(zb. dass du statt Norma2 einfach Normal2 schreiben könntest *g*)
Kleiner Tipp noch:
Normal = New Image();
Normal.src = "Btn_grey_dfl.gif";
Highlight1 = new Image();
Highlight1.src = "Btn_dia.gif";
Highlight2 = new Image();
Highlight2.src = "Btn_bf.gif";
Das reicht. Du musst nicht zweimal dasselbe Normalbild erstellen. Musst es nur entsprechend unten abändern. :o)
Gruß
Stefan
Hi,
stimmt ich habe einmal "Normal1" und "Norma2" 2 geschrieben. Das behebt den Fehler aber auch nicht.
Mit deinem Tipp Steffan kommt ein anderer Fehler nämlich sagt er das er bei "Normal = New Image();" beim 7. Zeichen, also beim "I" ein ";" erwartert.
Das ist doch völlig abnorm oder????
Danke