View Full Version : Javascript logo not functioning correctly.
AaronCPK
Feb 11th 2007, 5:02 pm
Hi all, new here, hoping to get some help with a new site.
I made a new logo for my site, and the links at the bottom of it are supposed to change to a different image (just a lighter version of the same word). The code was generated by Painter but I changed it around a little bit because I moved some directories around.
The website is HotRodKush.com
Is this a server problem or is my code screwed up?
It looks perfect, there's no faults in the script that I can see, all of the commands are accurate and point to valid paths, etc., but I could be missing something obvious.
It's alot to read through, but if you have nothing else to do take a quick look :)
Thanks alot for any help,
Aaron
AaronCPK
Feb 11th 2007, 5:03 pm
Here's the code if it makes it easier:
<script language="JavaScript"><!-- // This JavaScript code was automatically generated by // Painter 7 if(document.images){ mouseOverArray = new Array();
// preload image 1
mouseOverArray["photo_off"] = new Image(73, 17); mouseOverArray["photo_off"].src = "imageslices/photo_off.jpg"; mouseOverArray["photo_on"] = new Image(73, 17); mouseOverArray["photo_on"].src = "imageslices/photo_on.jpg"; mouseOverArray["photo_text"] = "Photo";
// preload image 2 mouseOverArray["video_off"] = new Image(74, 17); mouseOverArray["video_off"].src = "imageslices/video_off.jpg"; mouseOverArray["video_on"] = new Image(74, 17); mouseOverArray["video_on"].src = "imageslices/video_on.jpg"; mouseOverArray["video_text"] = "Video";
// preload image 3 mouseOverArray["explore_off"] = new Image(103, 17); mouseOverArray["explore_off"].src = "imageslices/explore_off.jpg"; mouseOverArray["explore_on"] = new Image(103, 17); mouseOverArray["explore_on"].src = "imageslices/explore_on.jpg"; mouseOverArray["explore_text"] = "Explore";
// preload image 4 mouseOverArray["contact_off"] = new Image(104, 17); mouseOverArray["contact_off"].src = "imageslices/contact_off.jpg"; mouseOverArray["contact_on"] = new Image(104, 17); mouseOverArray["contact_on"].src = "imageslices/contact_on.jpg"; mouseOverArray["contact_text"] = "Contact";
// preload image 5 mouseOverArray["home_off"] = new Image(71, 17); mouseOverArray["home_off"].src = "imageslices/home_off.jpg"; mouseOverArray["home_on"] = new Image(71, 17); mouseOverArray["home_on"].src = "imageslices/home_on.jpg"; mouseOverArray["home_text"] = "Home";
} function doMouseOver( imgName, state ) { // performs mouseover image and status bar text swapping // imgName is the HTML image name specified in the
<img> tag // state must be on, off or down // hide from browsers that don't support the image object if ( !document.images ) return false; // replace image document.images[ imgName ].src = mouseOverArray[ imgName + "_" + state ].src; // if needed, display or clear the status bar text if ( mouseOverArray[ imgName + "_text" ] != "" ) { if ( state != "off" ) { window.status = mouseOverArray[ imgName + "_text" ]; return true; //supresses display of link URL in on MouseOver } else { window.status = ""; return false; } } return false; }// --></script>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="788"> <tr>
<td width="112" height="0"><spacer type="block" width="112" height="0"></td>
<td width="73" height="0"><spacer type="block" width="73" height="0"></td>
<td width="39" height="0"><spacer type="block" width="39" height="0"></td>
<td width="74" height="0"><spacer type="block" width="74" height="0"></td>
<td width="45" height="0"><spacer type="block" width="45" height="0"></td>
<td width="103" height="0"><spacer type="block" width="103" height="0"></td>
<td width="43" height="0"><spacer type="block" width="43" height="0"></td>
<td width="104" height="0"><spacer type="block" width="104" height="0"></td>
<td width="28" height="0"><spacer type="block" width="28" height="0"></td>
<td width="71" height="0"><spacer type="block" width="71" height="0"></td>
<td width="95" height="0"><spacer type="block" width="95" height="0"></td>
<td width="0" height="0"></td> </tr> <tr>
<td width="112" height="164"><img src="imageslices/Image1.gif" name="Image1" width="112" height="164" alt="" border="0"></td>
<td width="73" height="164"><img src="imageslices/Image2.gif" name="Image2" width="73" height="164" alt="" border="0"></td>
<td width="39" height="164"><img src="imageslices/Image3.gif" name="Image3" width="39" height="164" alt="" border="0"></td>
<td width="74" height="164"><img src="imageslices/Image4.gif" name="Image4" width="74" height="164" alt="" border="0"></td>
<td width="45" height="164"><img src="imageslices/Image5.gif" name="Image5" width="45" height="164" alt="" border="0"></td>
<td width="103" height="164"><img src="imageslices/Image6.gif" name="Image6" width="103" height="164" alt="" border="0"></td>
<td width="43" height="164"><img src="imageslices/Image7.gif" name="Image7" width="43" height="164" alt="" border="0"></td>
<td width="104" height="164"><img src="imageslices/Image8.gif" name="Image8" width="104" height="164" alt="" border="0"></td>
<td width="28" height="164"><img src="imageslices/Image9.gif" name="Image9" width="28" height="164" alt="" border="0"></td>
<td width="71" height="164"><img src="imageslices/Image10.gif" name="Image10" width="71" height="164" alt="" border="0"></td>
<td width="96" height="164"><img src="imageslices/Image11.gif" name="Image11" width="96" height="164" alt="" border="0"></td>
<td width="0" height="164"></td> </tr> <tr>
<td width="112" height="1"><img src="imageslices/Image12.gif" name="Image12" width="112" height="1" alt="" border="0"></td>
<td width="73" height="1"><img src="imageslices/Image13.gif" name="Image13" width="73" height="1" alt="" border="0"></td>
<td width="39" height="1"><img src="imageslices/Image14.gif" name="Image14" width="39" height="1" alt="" border="0"></td>
<td width="74" height="1"><img src="imageslices/Image15.gif" name="Image15" width="74" height="1" alt="" border="0"></td>
<td width="45" height="1"><img src="imageslices/Image16.gif" name="Image16" width="45" height="1" alt="" border="0"></td>
<td width="103" height="1"><img src="imageslices/Image17.gif" name="Image17" width="103" height="1" alt="" border="0"></td>
<td width="43" height="1"><img src="imageslices/Image18.gif" name="Image18" width="43" height="1" alt="" border="0"></td>
<td width="104" height="1"><img src="imageslices/Image19.gif" name="Image19" width="104" height="1" alt="" border="0"></td>
<td width="28" height="1"><img src="imageslices/Image20.gif" name="Image20" width="28" height="1" alt="" border="0"></td>
<td width="71" height="1"><img src="imageslices/Image21.gif" name="Image21" width="71" height="1" alt="" border="0"></td>
<td width="96" height="1"><img src="imageslices/Image22.gif" name="Image22" width="96" height="1" alt="" border="0"></td>
<td width="0" height="1"></td> </tr> <tr>
<td width="112" height="1"><img src="imageslices/Image23.gif" name="Image23" width="112" height="1" alt="" border="0"></td>
<td width="73" height="1"><img src="imageslices/Image24.gif" name="Image24" width="73" height="1" alt="" border="0"></td>
<td width="39" height="1"><img src="imageslices/Image25.gif" name="Image25" width="39" height="1" alt="" border="0"></td>
<td width="74" height="1"><img src="imageslices/Image26.gif" name="Image26" width="74" height="1" alt="" border="0"></td>
<td width="45" height="1"><img src="imageslices/Image27.gif" name="Image27" width="45" height="1" alt="" border="0"></td>
<td width="103" height="1"><img src="imageslices/Image28.gif" name="Image28" width="103" height="1" alt="" border="0"></td>
<td width="43" height="1"><img src="imageslices/Image29.gif" name="Image29" width="43" height="1" alt="" border="0"></td>
<td width="104" height="1"><img src="imageslices/Image30.gif" name="Image30" width="104" height="1" alt="" border="0"></td>
<td width="28" height="1"><img src="imageslices/Image31.gif" name="Image31" width="28" height="1" alt="" border="0"></td>
<td width="71" height="1"><img src="imageslices/Image32.gif" name="Image32" width="71" height="1" alt="" border="0"></td>
<td width="96" height="1"><img src="imageslices/Image33.gif" name="Image33" width="96" height="1" alt="" border="0"></td>
<td width="0" height="1"></td> </tr> <tr>
<td width="112" height="17"><img src="imageslices/Image34.gif" name="Image34" width="112" height="17" alt="" border="0"></td>
<td width="73" height="17"><a href="http://www.hotrodkush.com/photo" onMouseOver="return doMouseOver('photo', 'on');" onMouseOut="doMouseOver('photo', 'off');">
<img src="imageslices/photo_off.jpg" name="photo" width="73" height="17" alt="Photo" border="0"></a></td>
<td width="39" height="17"><img src="imageslices/Image36.gif" name="Image36" width="39" height="17" alt="" border="0"></td>
<td width="74" height="17"><a href="http://www.hotrodkush.com/video" onMouseOver="return doMouseOver('video', 'on');" onMouseOut="doMouseOver('video', 'off');">
<img src="imageslices/video_off.jpg" name="video" width="74" height="17" alt="Video" border="0"></a></td>
<td width="45" height="17"><img src="imageslices/Image38.gif" name="Image38" width="45" height="17" alt="" border="0"></td>
<td width="103" height="17"><a href="http://www.hotrodkush.com/explore" onMouseOver="return doMouseOver('explore', 'on');" onMouseOut="doMouseOver('explore', 'off');">
<img src="imageslices/explore_off.jpg" name="explore" width="103" height="17" alt="Explore" border="0"></a></td>
<td width="43" height="17"><img src="imageslices/Image40.gif" name="Image40" width="43" height="17" alt="" border="0"></td>
<td width="104" height="17"><a href="http://www.hotrodkush.com/contact" onMouseOver="return doMouseOver('contact', 'on');" onMouseOut="doMouseOver('contact', 'off');">
<img src="imageslices/contact_off.jpg" name="contact" width="104" height="17" alt="Contact" border="0"></a></td>
<td width="28" height="17"><img src="imageslices/Image42.gif" name="Image42" width="28" height="17" alt="" border="0"></td>
<td width="71" height="17"><a href="http://www.hotrodkush.com" onMouseOver="return doMouseOver('home', 'on');" onMouseOut="doMouseOver('home', 'off');">
<img src="imageslices/home_off.jpg" name="home" width="71" height="17" alt="Home" border="0"></a></td>
<td width="96" height="17"><img src="imageslices/Image44.gif" name="Image44" width="96" height="17" alt="" border="0"></td>
<td width="0" height="16"></td> </tr></table>
AaronCPK
Feb 12th 2007, 2:38 pm
hmm, Anyone?
Logic Ali
Feb 12th 2007, 4:37 pm
Hi all, new here, hoping to get some help with a new site.
I made a new logo for my site, and the links at the bottom of it are supposed to change to a different image (just a lighter version of the same word). The code was generated by Painter but I changed it around a little bit because I moved some directories around.
The website is HotRodKush.com
Is this a server problem or is my code screwed up?
It looks perfect, there's no faults in the script that I can see, all of the commands are accurate and point to valid paths, etc., but I could be missing something obvious.
It's alot to read through, but if you have nothing else to do take a quick look :)
You're not using the JS console, which tells us straight away that doMouseOver doesn't exist. Your code has wrapped at some point, so some of the single-line comments '//' are cancelling parts of the code.
You have three alternatives:
a) Restore the line breaks so that code following comments starts on a new line.
b) Re-do the comments so that they start /* and end */
c) Delete all the comments.
AaronCPK
Feb 12th 2007, 5:22 pm
Thanks, I'll give it a try!
AaronCPK
Feb 12th 2007, 5:29 pm
Genius, I did choice A and it's working perfectly now, thank you very much!
One more quick question - is there a way to make a CSS-type file that will contain the javascript and tables for the logo that I can point to on the individual pages, so I don't have to have all of this code on every HTML file on my site?
Thanks again, I appreciate the help.
AaronCPK
Feb 14th 2007, 5:48 pm
Nevermind, figured it out with a .js file
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.