Oct 19, 2007 #1 karlad Programmer Oct 19, 2007 3 CA I'm trying to get the 'profile', 'credits' etc buttons to change color on mouseover with javascript. Not sure what I'm doing wrong? Thanks In Advance!
I'm trying to get the 'profile', 'credits' etc buttons to change color on mouseover with javascript. Not sure what I'm doing wrong? Thanks In Advance!
Oct 19, 2007 #2 trollacious Programmer Sep 29, 2004 4,046 US Use Firefox to view the page, and look at the error console to get some ideas of the problems on your page. Lee Upvote 0 Downvote
Use Firefox to view the page, and look at the error console to get some ideas of the problems on your page. Lee
Oct 19, 2007 Thread starter #3 karlad Programmer Oct 19, 2007 3 CA I didn't see any error console. Below is my script. </head> <script LANGUAGE="JavaScript"> <!-- if (document.images) { img1on = new Image(); // On Images img1on.src = "http://www.freeflyfilms.com/images/profilew.jpg"; img2on = new Image(); img2on.src = "http://www.freeflyfilms.com/images/creditsw.jpg"; img3on = new Image(); img3on.src = "hhttp://www.freeflyfilms.com/images/newsw.jpg"; img4on = new Image(); img4on.src = "http://www.freeflyfilms.com/images/photosw.jpg"; img5on = new Image(); img5on.src = "http://www.freeflyfilms.com/images/contactsw.jpg"; img6on = new Image(); img6on.src = "http://www.freeflyfilms.com/images/linksw.jpg"; img1off = new Image(); // Off Images img1off.src = "http://www.freeflyfilms.com/images/profile.jpg"; img2off = new Image(); img2off.src = "http://www.freeflyfilms.com/images/credits.jpg"; img3off = new Image(); img3off.src = "http://www.freeflyfilms.com/images/news.jpg"; img4off = new Image(); img4off.src = "http://www.freeflyfilms.com/images/photos.jpg"; img5off = new Image(); img5off.src = "http://www.freeflyfilms.com/images/contacts.jpg"; img6off = new Image(); img6off.src = "http://www.freeflyfilms.com/images/links.jpg"; } function imgOn(imgName) { if (document.images) { document .src = eval(imgName + "on.src"); }} function imgOff(imgName) { if (document.images) { document .src = eval(imgName + "off.src"); }} //--> </script> <body bgcolor=#000000 background=images/dark.jpg> <div align=center> <center> <table border=0 width=795 height=595 bgcolor=#000000 cellpadding=0 cellspacing=0> <tr> <td width=795 valign=middle align=center height="84" colspan="7"> <div align=center> <table border=0 width=795 cellspacing="0" cellpadding="0" height="84"> <tr> <td width=50%><img border="0" src="images/homeadren1.jpg" width="249" height="84"></td> <td width=50%><img border="0" src="images/homeadren2.jpg" width="546" height="84"></td> </tr> </table> </div> </td> </tr> <tr> <td width=795 valign=middle align=center height="147" colspan="7"> <div align=center> <table border=0 width=795 cellspacing="0" cellpadding="0" height="147"> <tr> <td width=249 height="147"><img border="0" src="images/homefilmstrip1.jpg" width="249" height="147"></td> <td width=177 height="147"><img border="0" src="images/homefilmstrip2.jpg" width="177" height="147"></td> <td width=120 height="147"><img border="0" src="images/homefilmstrip3.jpg" width="120" height="147"></td> <td width=117% height="147"><img border="0" src="images/homefilmstrip4.jpg" width="117" height="147"></td> <td width=20%><img border="0" src="images/homefilmstrip5.jpg" width="132" height="147"></td> </tr> </table> </div> </td> </tr> <tr> <td width=249 valign=middle align=center height="27"> <img border="0" src="images/homewords1.jpg" width="249" height="27"> </td> <td width=103 valign=middle align=center height="27"> <a href="profile.htm" onMouseOver="imgOn('img1')" onMouseOut="imgOff('img1')" ><img NAME='img1' border="0" src="images/profile.jpg" width="103" height="27"></a></td> <td width=90 valign=middle align=center height="27"> <a href="credits.htm" onMouseOut="imgOff('img2')" onMouseOver="imgOn('img2')" ><img NAME='img1' border="0" src="images/credits.jpg" width="90" height="27"> </a> </td> <td width=66 valign=middle align=center height="27"> <a href="news.htm" onMouseOut="imgOff('img3')" onMouseOver="imgOn('img3')" ><img NAME='img1' border="0" src="images/news.jpg" width="66" height="27"> </a> </td> <td width=91 valign=middle align=center height="27"> <a href="photos.htm" onMouseOut="imgOff('img4')" onMouseOver="imgOn('img4')" ><img NAME='img1' border="0" src="images/photos.jpg" width="91" height="27"> </a> </td> <td width=104 valign=middle align=center height="27"> <a href="contact.htm" onMouseOut="imgOff('img5')" onMouseOver="imgOn('img5')" ><img NAME='img1' border="0" src="images/contact.jpg" width="104" height="27"> </a> </td> <td width=92 valign=middle align=center height="27"> <a href="links.htm" onMouseOut="imgOff('img6')" onMouseOver="imgOn('img6')" ><img NAME='img1' border="0" src="images/links.jpg" width="92" height="27"> </a> </td> </tr> <tr> <td width=795 valign=middle align=center colspan="7" height="297"> Upvote 0 Downvote
I didn't see any error console. Below is my script. </head> <script LANGUAGE="JavaScript"> <!-- if (document.images) { img1on = new Image(); // On Images img1on.src = "http://www.freeflyfilms.com/images/profilew.jpg"; img2on = new Image(); img2on.src = "http://www.freeflyfilms.com/images/creditsw.jpg"; img3on = new Image(); img3on.src = "hhttp://www.freeflyfilms.com/images/newsw.jpg"; img4on = new Image(); img4on.src = "http://www.freeflyfilms.com/images/photosw.jpg"; img5on = new Image(); img5on.src = "http://www.freeflyfilms.com/images/contactsw.jpg"; img6on = new Image(); img6on.src = "http://www.freeflyfilms.com/images/linksw.jpg"; img1off = new Image(); // Off Images img1off.src = "http://www.freeflyfilms.com/images/profile.jpg"; img2off = new Image(); img2off.src = "http://www.freeflyfilms.com/images/credits.jpg"; img3off = new Image(); img3off.src = "http://www.freeflyfilms.com/images/news.jpg"; img4off = new Image(); img4off.src = "http://www.freeflyfilms.com/images/photos.jpg"; img5off = new Image(); img5off.src = "http://www.freeflyfilms.com/images/contacts.jpg"; img6off = new Image(); img6off.src = "http://www.freeflyfilms.com/images/links.jpg"; } function imgOn(imgName) { if (document.images) { document .src = eval(imgName + "on.src"); }} function imgOff(imgName) { if (document.images) { document .src = eval(imgName + "off.src"); }} //--> </script> <body bgcolor=#000000 background=images/dark.jpg> <div align=center> <center> <table border=0 width=795 height=595 bgcolor=#000000 cellpadding=0 cellspacing=0> <tr> <td width=795 valign=middle align=center height="84" colspan="7"> <div align=center> <table border=0 width=795 cellspacing="0" cellpadding="0" height="84"> <tr> <td width=50%><img border="0" src="images/homeadren1.jpg" width="249" height="84"></td> <td width=50%><img border="0" src="images/homeadren2.jpg" width="546" height="84"></td> </tr> </table> </div> </td> </tr> <tr> <td width=795 valign=middle align=center height="147" colspan="7"> <div align=center> <table border=0 width=795 cellspacing="0" cellpadding="0" height="147"> <tr> <td width=249 height="147"><img border="0" src="images/homefilmstrip1.jpg" width="249" height="147"></td> <td width=177 height="147"><img border="0" src="images/homefilmstrip2.jpg" width="177" height="147"></td> <td width=120 height="147"><img border="0" src="images/homefilmstrip3.jpg" width="120" height="147"></td> <td width=117% height="147"><img border="0" src="images/homefilmstrip4.jpg" width="117" height="147"></td> <td width=20%><img border="0" src="images/homefilmstrip5.jpg" width="132" height="147"></td> </tr> </table> </div> </td> </tr> <tr> <td width=249 valign=middle align=center height="27"> <img border="0" src="images/homewords1.jpg" width="249" height="27"> </td> <td width=103 valign=middle align=center height="27"> <a href="profile.htm" onMouseOver="imgOn('img1')" onMouseOut="imgOff('img1')" ><img NAME='img1' border="0" src="images/profile.jpg" width="103" height="27"></a></td> <td width=90 valign=middle align=center height="27"> <a href="credits.htm" onMouseOut="imgOff('img2')" onMouseOver="imgOn('img2')" ><img NAME='img1' border="0" src="images/credits.jpg" width="90" height="27"> </a> </td> <td width=66 valign=middle align=center height="27"> <a href="news.htm" onMouseOut="imgOff('img3')" onMouseOver="imgOn('img3')" ><img NAME='img1' border="0" src="images/news.jpg" width="66" height="27"> </a> </td> <td width=91 valign=middle align=center height="27"> <a href="photos.htm" onMouseOut="imgOff('img4')" onMouseOver="imgOn('img4')" ><img NAME='img1' border="0" src="images/photos.jpg" width="91" height="27"> </a> </td> <td width=104 valign=middle align=center height="27"> <a href="contact.htm" onMouseOut="imgOff('img5')" onMouseOver="imgOn('img5')" ><img NAME='img1' border="0" src="images/contact.jpg" width="104" height="27"> </a> </td> <td width=92 valign=middle align=center height="27"> <a href="links.htm" onMouseOut="imgOff('img6')" onMouseOver="imgOn('img6')" ><img NAME='img1' border="0" src="images/links.jpg" width="92" height="27"> </a> </td> </tr> <tr> <td width=795 valign=middle align=center colspan="7" height="297">
Oct 19, 2007 Thread starter #4 karlad Programmer Oct 19, 2007 3 CA I got it working ) Upvote 0 Downvote