Hover Button

liunx

Guest
I have a problem that I can't figure out. I want to hover over a button and have it change on the hover to a new image. <br />
<br />
All the code for this functionality is in a header which is called from the main page using #include. If I run the header by itself, the hover works. The problem is if I run the main page, now the hover doesn't work. I don't understand why??? Is it something to do with the call to the include file (the header)?<br />
<br />
Can someone help please???<br />
<br />
Thanks.<!--content-->it would be helpful to post your code so as i know what youre dealing with<!--content-->The code i am using for the hover button functionality is below. As I mentioned, it works fine when I run the header by itself, but when I run the main page which calls the header code through an include, now it does not work.<br />
<br />
<SCRIPT LANGUAGE="javascript"><br />
<!--<br />
if (parseInt(navigator.appVersion) > 2)<br />
{<br />
//Load all images<br />
var Home = new Image(20,48);<br />
var HomeOn = new Image(20,48);<br />
<br />
//Setting the SRC of the image to the GIFs<br />
Home.src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"../images/Home.gif";<br />
HomeOn.src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"../images/HomeOn.gif";<br />
<br />
}<br />
<br />
//Called from the onmouseover and onmouseout events to set the specific image. "<br />
function setImage(imgName, type)<br />
{<br />
var imgFile = eval(imgName + type + ".src");<br />
<br />
if (document.images)<br />
{<br />
document.images[imgName].src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/imgFile;">http://www.webdeveloper.com/forum/archi ... p/imgFile;</a><!-- m --><br />
<br />
return false;<br />
}<br />
}<br />
<br />
--><br />
</SCRIPT><br />
<br />
Here is the line I use for the hover functionality:<br />
<br />
<td valign="top"><a href=http://www.webdeveloper.com/forum/archive/index.php/"index.asp" onmouseover="return setImage('Home','On')" onmouseout="return setImage('Home','')"><IMG src=http://www.webdeveloper.com/forum/archive/index.php/"images/Home.gif" alt="" name="Home" height="20" width="48" border="0"></a></td><br />
<br />
And this is how I call the include file from the main page:<br />
<br />
<!--#include file="includes/header.asp" --><br />
<br />
If someone can help, it would be greatly appreciated. I can't figure out why it works on it's own, but won't work when called from the main page. Is it something to do with the include???<br />
<br />
Thanks.<!--content-->
 
Back
Top