20. Oktober 200421 j Hallo zusammen, ich möchte gern ein Menü mit zwei Bildern machen. Und zwar mit onClick / mouseOver und mouseOut. Mein Problem ist nun, dass ich es bis jetzt nur mit mouseOver und mouseOut funktioniert. Wenn ich onClick benutze passiert nichts. Was mach ich falsch? Gruß TripleD
20. Oktober 200421 j Mh... Ich weiß nicht ob es Dir hilft aber ich habs so bei mir gelöst ! Also mit 2 Bildern ! Meine Seite liegt in einem Frame-set,also wenn Du kein Frame-set hast dann nimm das Base Target raus oder ändere es auf Dein Frame-set um ! <title></title> <base target="haupt"> <meta name="author" content="Steve"> <meta http-equiv="imagetoolbar" content="no"> </head> <body background="../pics/oben.jpg" style="margin:0"> <table cellspacing="0" style="margin:0" height="100%" cellpadding="0"> <tr valign="bottom"> <td><a href="haupt.php" onmouseover="swap('imgLink1','Link1on')" onmouseout="swap('imgLink1','Link1')" onFocus="this.blur()"><img name="imgLink1" src="../pics/buttons/Home.gif" WIDTH="76" HEIGHT="13" border=0 alt=""></a></td> <td><a href="pic.php" onmouseover="swap('imgLink2','Link2on')" onmouseout="swap('imgLink2','Link2')" onFocus="this.blur()"><img name="imgLink2" src="../pics/buttons/pics.gif" WIDTH="76" HEIGHT="13" border=0 alt=""></a><br></td> <td><a href="history.php" onmouseover="swap('imgLink3','Link3on')" onmouseout="swap('imgLink3','Link3')" onFocus="this.blur()"><img name="imgLink3" src="../pics/buttons/History.gif" WIDTH="76" HEIGHT="13" border=0 alt=""></a><br></td> <td><a href="event/event.php" onmouseover="swap('imgLink4','Link4on')" onmouseout="swap('imgLink4','Link4')" onFocus="this.blur()"><img name="imgLink4" src="../pics/buttons/event.gif" WIDTH="76" HEIGHT="13" border=0 alt=""></a></td> <td><a href="sport.php" onmouseover="swap('imgLink5','Link5on')" onmouseout="swap('imgLink5','Link5')" onFocus="this.blur()"><img name="imgLink5" src="../pics/buttons/sport.gif" WIDTH="76" HEIGHT="13" border=0 alt=""></a></td> <td><a href="gb.php" onmouseover="swap('imgLink6','Link6on')" onmouseout="swap('imgLink6','Link6')" onFocus="this.blur()"><img name="imgLink6" src="../pics/buttons/guestbook.gif" WIDTH="76" HEIGHT="13" border=0 alt=""></a></td> <td><a href="download.php" onmouseover="swap('imgLink7','Link7on')" onmouseout="swap('imgLink7','Link7')" onFocus="this.blur()"><img name="imgLink7" src="../pics/buttons/download.gif" WIDTH="76" HEIGHT="13" border=0 alt=""></a></td> <td><a href="contact.php" onmouseover="swap('imgLink8','Link8on')" onmouseout="swap('imgLink8','Link8')" onFocus="this.blur()"><img name="imgLink8" src="../pics/buttons/contact.gif" WIDTH="76" HEIGHT="13" border=0 alt=""></a><br></td> </tr> </table> <SCRIPT LANGUAGE = "JavaScript"> <!-- browserName = navigator.appName; browserVer = parseInt(navigator.appVersion); browser = "NotOk"; // Überprüft ob Deine Browser Version kompatibel ist if (browserName == "Netscape" && browserVer >= 3) { browser = "ok"} if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) { browser = "ok"} // Bilder initialisieren if (browser == "ok") { Link1= new Image(); Link1.src= "../pics/buttons/home.gif"; Link1on = new Image(); Link1on.src= "../pics/buttons/home2.gif"; Link2= new Image(); Link2.src= "../pics/buttons/pics.gif"; Link2on = new Image(); Link2on.src= "../pics/buttons/pics2.gif"; Link3= new Image(); Link3.src= "../pics/buttons/history.gif"; Link3on = new Image(); Link3on.src= "../pics/buttons/history2.gif"; Link4= new Image(); Link4.src= "../pics/buttons/event.gif"; Link4on = new Image(); Link4on.src= "../pics/buttons/event2.gif"; Link5= new Image(); Link5.src= "../pics/buttons/sport.gif"; Link5on = new Image(); Link5on.src= "../pics/buttons/sport2.gif"; Link6= new Image(); Link6.src= "../pics/buttons/guestbook.gif"; Link6on = new Image(); Link6on.src= "../pics/buttons/guestbook2.gif"; Link7= new Image(); Link7.src= "../pics/buttons/download.gif"; Link7on = new Image(); Link7on.src= "../pics/buttons/download2.gif"; Link8= new Image(); Link8.src= "../pics/buttons/contact.gif"; Link8on = new Image(); Link8on.src= "../pics/buttons/contact2.gif"; } function swap(imgName,select) { if (browser == "ok") {imgOn = eval(select+ ".src"); document.images[imgName].src = imgOn; }} //--> </script> </body> </html>
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.