Results 1 to 8 of 8

Thread: HELP! Can't get mouseout argument to work

  1. #1
    Join Date
    Dec 2005
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HELP! Can't get mouseout argument to work

    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 it not work: http://www.qdobanv.com/new_page_2.htm

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

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You want to use a semicolon, not a comma, to seperate statements.
    Code:
    onmouseover="image1.src='http://www.qdobanv.com/LanitechArtwork/button_home_on.gif', dropdownmenu(this, event, 'anylinkmenu1');"
    The problem is the fact that you've given your Image objects the same names as your actual images. If you change the names of these:
    Code:
    image1 = new Image();
    image1.src = "http://www.qdobanv.com/LanitechArtwork/button_home_on.gif";
    image2 = new Image();
    image2.src = "http://www.qdobanv.com/LanitechArtwork/button_menu_on.gif";
    image3 = new Image();
    image3.src = "http://www.lanitech.com/ArtworkNew/Button-Portfolio-On.gif";
    image4 = new Image();
    image4.src = "http://www.lanitech.com/ArtworkNew/Button-RequestAQuote-On.gif";
    image5 = new Image();
    image5.src = "http://www.lanitech.com/ArtworkNew/Button-Contact-On.gif";
    so that they don't conflict with the actual HTML images, you'll be fine.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2005
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks, but I need clarification PLEASE

    Hi, you said to change the "," to a ";" and I did, but I am not quite sure about your second statement to change names of these: which are my preloaded images. Not sure what "change the names" means? Can yo u please clarify? Thanks much!

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    For example:
    Code:
    image1_p = new Image();
    image1_p.src = "http://www.qdobanv.com/LanitechArtwork/button_home_on.gif";
    image2_p = new Image();
    image2_p.src = "http://www.qdobanv.com/LanitechArtwork/button_menu_on.gif";
    image3_p = new Image();
    image3_p.src = "http://www.lanitech.com/ArtworkNew/Button-Portfolio-On.gif";
    image4_p = new Image();
    image4_p.src = "http://www.lanitech.com/ArtworkNew/Button-RequestAQuote-On.gif";
    image5_p = new Image();
    image5_p.src = "http://www.lanitech.com/ArtworkNew/Button-Contact-On.gif";
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Dec 2005
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Changed it but still no workie

    Hello again,

    I've changed my preload image script as you recommended and still my mouseout doesn't work. Plus I separated the statements with a semi colon.

    Anything else you can see wrong? I'm at a complete total loss on this one :-(

    (PS thanks for the quick reponses!)

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Hm, no. Very peculiar.
    At least the mouseover works for me now -- it didn't before.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Dec 2005
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know!? It's driving me NUTZ!
    Thinking about canning the script all together, skip the drop down and use something else.

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    There's nothing wrong with the dropdown. Try rewriting that bit of your page from scratch. There's got to be something wrong with it :-\
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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