Drew Posted July 8, 2006 Share Posted July 8, 2006 I appear to be an idiot. If anyone could tell me what's wrong with my java script rollover code, I would be most appreciative. While Weidu is clearly not Java, I'm figuring that this is as good a place as any to ask the question. <!-- Old Browsers Ignore the Following <script language="JavaScript"> function goToLink(form) { location.href = form.options[form.selectedIndex].value; } //mouseover effects if (document.images) { glossyon = new Image(); glossyon.src = "../web_graphics/glossyon.gif"; glossyoff = new Image(); glossyoff.src = "../web_graphics/glossyoff.gif"; } function imgOn(imgName,imgObjName) { if (document.images) { document[imgName].src = imgObjName; } } function imgOff(imgName,imgObjName) { if (document.images) { document[imgName].src = imgObjName; } } </script> --> In body: <a href="../pages/potn.html" onMouseOver="imgOn('glossy','../web_graphics/glossyon.gif)" onMouseOut="imgOff('glossyOff','../web_graphics/glossyoff.gif')" title="Read more about Prince of the Narwhals"> <img src="../web_graphics/glossyoff.gif" width="30" height="30" border="0" name="glossy"></a> Link to comment
CamDawg Posted July 8, 2006 Share Posted July 8, 2006 tbh, I'd suggest ditching the javascript and using CSS rollovers so you can reach that 10% of users that don't have JS enabled. You can assign the images as backround to a and the hover image to a:hover. Link to comment
Drew Posted July 8, 2006 Author Share Posted July 8, 2006 Thanks. I didn't think I could do that with images, too. That'll definitely be easier. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.