...

View Full Version : NEED HELP ASAP w/ mouseout argument



vlane95678
12-15-2005, 03:21 AM
Hello, I am using a js script with a mouseover w/ drop down menu from this web site.

Everything works find but the mouseout argument. When you mouseout, the image stays the same and it should change. Here's the JS code:

<a onmouseover="image1.src='http://www.qdobanv.com/LanitechArtwork/button_home_on.gif', dropdownmenu(this, event, 'anylinkmenu1');" onmouseout="image1.src='http://www.qdobanv.com/LanitechArtwork/button_home_off.gif';" target="_self" href="index.htm">
<img name="image1" src="LanitechArtwork/button_home_off.gif" border="0" width="91" height="39"></a>

And here's the drop down menu code (which I don't think matters anyhow):

<!--1st anchor link and menu -->
<div id="anylinkmenu1" class="anylinkcss">
<a href="http://www.dynamicdrive.com/">Dynamic Drive</a>
<a href="http://www.cssdrive.com">CSS Drive</a>
<a href="http://www.javascriptkit.com">JavaScript Kit</a>
<a href="http://www.codingforums.com">Coding Forums</a>
<a href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a>
</div>


Here's a link to the page to see how it does not work: http://www.qdobanv.com/new_page_2.htm

CAN ANYONE SEE WHAT THE HECK I'M DOING WRONG?

BaldEagle
12-15-2005, 04:26 AM
<a target="_self" href="index.htm">
<img name="image1" src="LanitechArtwork/button_home_off.gif" border="0" width="91"
height="39" onmouseover="this.src='http://www.qdobanv.com/LanitechArtwork/button_home_on.gif';
dropdownmenu(this, event, 'anylinkmenu1');"
onmouseout="this.src='http://www.qdobanv.com/LanitechArtwork/button_home_off.gif';" >
</a>

See if this works for you.

BaldEagle

BaldEagle
12-15-2005, 04:11 PM
My last post will not work either. I apologize for not looking thoroughly before posting a response. It seems that your js is hijacking your onmouseout so you will probably have to modify it to take care of your image as well.

BaldEagle

2reikis
12-15-2005, 10:27 PM
Jeez, it looks like it should work. It must be getting hung up in the .js file. Can you post that file.

Here's the weird thing. I copied your page source into a file on my computer, called it up in IE and it worked just fine. So the source of your problem is in anylink.js. That's the only thing I couldn't link to from your site. :( Maybe it needs a "return true" at the end?

Basscyst
12-16-2005, 12:32 AM
Try giving the image(s) an id and referencing them with getElementById.



<a onmouseover="document.getElementById('image1').src='http://www.qdobanv.com/LanitechArtwork/button_home_on.gif', dropdownmenu(this, event, 'anylinkmenu1');" onmouseout="document.getElementById('image1').src='http://www.qdobanv.com/LanitechArtwork/button_home_off.gif';" target="_self" href="index.htm">
<img name="image1" id="image1" src="LanitechArtwork/button_home_off.gif" border="0" width="91" height="39"></a>


Better still would be to put it in a function:



<script type="text/javascript">
function swapImage(obj_id,src)
{
document.getElementById(obj_id).src=src
}
</script>
<a onmouseover="swapImage('image1','LanitechArtwork/button_home_on.gif');dropdownmenu(this, event, 'anylinkmenu1');" onmouseout="swapImage('image1','LanitechArtwork/button_home_off.gif');" target="_self" href="index.htm">
<img name="image1" id="image1" src="LanitechArtwork/button_home_off.gif" border="0" width="91" height="39"></a>

Basscyst



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum