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 11 of 11
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help with two mouseover assignments

    i really need help with this and i'm hoping that i'm only missing something small... actually, i'm hoping that it is possible, period...

    i need to assign two mouseover functions to one button... you can view my progress at:

    http://www.theones.org/test

    as you can see, i have the larger of the mouseovers (an external image swap) working fine, but the simple image exchange isn't...

    is this possible and if so can you help explain what i am doing wrong???

    thank you so much in advance...

    dan'l

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    You had a few misplacements of quotation marks. Try out the following and see if it works.
    Code:
    <a href="URL.HTML" target="_blank" onmouseover="changeImages('otherImage', 'otherImage01'); document.01jpg.src='over_small.jpg';" onmouseout="changeImages('otherImage', 'otherImageDefault'); document.01jpg.src='orig_small.jpg';"><img src="orig_small.jpg" width="50" height="50" border="0" cache="true" name="01jpg"></a>

  • #3
    New Coder
    Join Date
    Mar 2004
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down situation worsens

    i've replaced the code with that which you suggested, but now you'll notice that neither images are swapping on mouseover:

    http://www.theones.org/test/test2.html

    (reminder - this is the page that i posted before:
    http://www.theones.org/test/index.html

    eeek...

  • #4
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm confused..

    Ok I'm going to number your images:
    1 - small image at the top
    2 - large image in the middle/right
    3 - small image at the bottom

    So let me get this right:
    -mouseover 1, changes 2
    -mouseout 1, changes 2

    -mouseover 2, changes 1 and 3?
    -mouseout 2, changes 1 and 3?

    -is there a mouseover/out on 3? if so what happens?

    Please clarify what's supposed to happen so we can help you better.

    Sadiq.

  • #5
    New Coder
    Join Date
    Mar 2004
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sorry

    okay, i hope i can be clearer (a weakness of mine)...

    i've changed the page again and hopefully i can clear things up this way...

    please see:

    http://www.theones.org/test/test3.html

    i'm now showing two small images in the top left corner that are connected by mouseover event to the large image to the right.

    as you'll see, when you mouseover each small image, there is a respective large image for EACH...

    this mouseover is working the way i would like it to.

    in addition to this, i would like the small images to change on the same mouseover event - there is only one image ("over_small.jpg") that i would like to apply to BOTH small images...

    example:

    user mouseover "orig_small1.jpg", small image changes to "over_small.jpg" AND "orig_large.jpg" changes to "over_large1.jpg"

    user mouseover "orig_small2.jpg", small image changes to "over_small.jpg" AND "orig_large.jpg" changes to "over_large2.jpg"

    does this help???

    *crosses fingers*

  • #6
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh I see, so the small image you're mousing-over, you want that image to change to a different image?

    Not so bad:
    Code:
    <A ONMOUSEOVER="changeImages('otherImage', 'otherImage01'); this.src = 'over_small.jpg'" ONMOUSEOUT="changeImages('otherImage', 'otherImageDefault'); this.src = 'orig_small1.jpg'"; document.01jpg.src='50p01.jpg';><img src="orig_small1.jpg" width="50" height="50" border="0" cache="true" name="01jpg"></a>
    The same goes for the other image.. I think that should work. Let me know how you make out with it.

    Sadiq.

  • #7
    New Coder
    Join Date
    Mar 2004
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well, i tried that but nothing seems to be affected... the buttons still act the same:

    http://www.theones.org/test/test3.html (mine)

    http://www.theones.org/test/test4.html (yours)


    hmmm... maybe i'm still not communicating my desires correctly...

    on mouseover i want both the small and large images to change simultaneously...

    waaaaaaaa...

  • #8
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Whoops! My fault... (you're communicating just fine!) use THIS code:
    Code:
    <A ONMOUSEOVER="changeImages('otherImage', 'otherImage01'); document.images['01jpg'].src = 'over_small.jpg'" ONMOUSEOUT="changeImages('otherImage', 'otherImageDefault'); document.images['01jpg'].src = 'orig_small1.jpg'"; document.01jpg.src='50p01.jpg';><img src="orig_small1.jpg" width="50" height="50" border="0" cache="true" name="01jpg"></a>
    I think that should work.

    Sadiq.

  • #9
    New Coder
    Join Date
    Mar 2004
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    YAY!!!!!!!!!

    you are my hero!!! now for me to examine your code so that i can understand what is happening AND apply it to the actual design that i am doing... thank you thank you thank you!!!

  • #10
    New Coder
    Join Date
    Nov 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    im so sorry if im not suppose to be adding to this thread, but i'm truly stuck, and I have the same prob as described by the thread previously. I am stuck for the last 1 hour, and found this site on google, hopefully someone is out there reading, PLEASE!! i'M trying to figure out how to proceed. Anyhow, I am trying to change two images when hovering over one image:


    http://www.columbia.edu/~xkm1/test.html
    (when hovering over exhibitions, i want the image to change as well as the picture.) as you can see, i got one, but not the other, I tried to apply the solution that was previously given, (and the empty code is in the bottom for reference), but it didn't work. someone please HELP!!

    Also, the link I associated with it doesn't seem to be working. HELP!!
    Last edited by sio2i; 11-16-2004 at 06:51 PM.

  • #11
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The image swap code you've got looks like it already handles multiple image swaps but you've got to provide all FOUR parameters for each image to be swapped. You do not need to provide any parameters at all for the mouseout code.
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

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