Results 1 to 9 of 9

Thread: Can MouseOver change two images?

  1. #1
    Join Date
    Sep 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can MouseOver change two images?

    Is it possible to have two images change on a mouse over? I am trying to get the image to swap where the mouse-over button is AND another image to swap elsewhere on the page.

    To make it more confusing, I am having a text box pop up at the mouse over as well. I have figured out how to do this and to swap the button image. I just don't understand how to make another image elsewhere on the page to swap during the mouseover.

    Is this possible? Oh, and I'm trying to avoid table and frames...

    Here is the URL: www.antiochsheffield.org

    Thank you!

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

    Default

    Yes, just seperate the statements with semicolons. Por ejemplo:
    Code:
    <a onclick="img1.src = 'img2.jpg';img3.src = 'img4.jpg';">
    Last edited by Twey; 09-19-2005 at 06:36 AM. Reason: Semicolons, darn 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!

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey
    Yes, just seperate the statements with commas
    What commas?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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

    Default

    Er, semicolons. Sorry. I'm really sliding at the moment >.<
    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
    Sep 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you! It had to be something simple, eh? I'll try it out now.

  6. #6
    Join Date
    Sep 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here's another idea - is it possible to change the color of a text box elsewhere on the page during a mouseover? Do I ask too much?

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

    Default

    Yes it is. By "color," do you mean background colour or text colour?
    You must give the textbox some sort of identification. One of the easiest ways of doing this is the "id" attribute. Imagine we had our textbox created like so:
    HTML Code:
    <input type="text" id="tb1"/>
    We would set its background colour like so:
    Code:
    document.getElementById('tb1').style.backgroundColor = "#0000FF";
    or its text colour like so:
    Code:
    document.getElementById('tb1').style.color = "#0000FF";
    You would enter this code into an onmouseover= attribute. You will need to manually change the colour back afterwards, if this is what you desire.
    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!

  8. #8
    Join Date
    Sep 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am trying to figure out how to do two mouseover events on a different page:
    www.antiochsheffield.org/staff.html
    I can get it to do what I want, but there is some sort of error. Here is the code:

    <A href="mailto:daniel@antiochsheffield.org" OnMouseOver="changetext(content[0]);
    document.images['myimage1'].src='images/guitar-strings.jpg'; return true;"
    onMouseOut="document.images['myimage1'].src='images/danielside.jpg'">
    <img src="images/danielside.jpg" name="myimage1"></A>

    Is there anyone who can help me? Thank you! Cheri

  9. #9
    Join Date
    Sep 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well - I sent the post and then I figured out a way to do it. Problem is fixed! Thanks.

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
  •