Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    NEED HELP ASAP w/ mouseout argument

    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?

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lisbon, CT
    Posts
    339
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <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
    Last edited by BaldEagle; 12-15-2005 at 03:58 PM.

  • #3
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lisbon, CT
    Posts
    339
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder 2reikis's Avatar
    Join Date
    Nov 2005
    Location
    New Mexico, USA
    Posts
    174
    Thanks
    18
    Thanked 13 Times in 13 Posts

    Question got me scratchin'

    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?
    Last edited by 2reikis; 12-15-2005 at 11:30 PM.

  • #5
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Try giving the image(s) an id and referencing them with getElementById.

    Code:
    <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:

    Code:
    <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
    Last edited by Basscyst; 12-16-2005 at 01:37 AM.
    Helping to build a bigger box. - Adam Matthews


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •