February 6th, 2013, 07:28 PM
The following "up" and "down" arrows work in an html document. Initially they show as a blue arrow and change to green on mouseover.
This first code has the arrow pointing "down" and the arrow changes to green on mouseover.
<a onmouseover="SwitchImg('document.arrow','document.arrow','images/greenarrow.gif')" onmouseout="RestoreImg()" href="#bottom"><img border="0" name="arrow" alt="Click" src="images/bluearrow.gif" width="23" height="32">
This code has the arrow pointing up, it works but the image does not change color on mouseover. I've double checked the spelling of all the gifs.
<a onmouseover="SwitchImg('document.arrow','document.arrow','images/greenarrowup.gif')" onmouseout="RestoreImg()" href="#top"><img border="0" name="arrow" alt="Click" src="images/bluearrowup.gif" width="23" height="32"></a>
Thank you, any help would be appreciated.
February 7th, 2013, 01:02 AM
Right off hand, without even looking @ your function(s)... the problem I see... is that you have both the images named "arrow". You need to name each image with a unique name and not name them, with the identically same name. This means you also need to change the parameter of your function for the image element's onmouseover and onmouseout event(s), as well.
Originally Posted by elder76
Last edited by web_loone08; February 7th, 2013 at 01:05 AM.
February 7th, 2013, 10:44 PM
Thank you for your reply. I gave up on the code that I sent and turned to CSS at the advice of another coder. It was a much more elegant a solution and worked fine.
Originally Posted by web_loone08
Comments on this post