PDA

View Full Version : Can MouseOver change two images?



cheri
09-18-2005, 05:49 PM
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!

Twey
09-18-2005, 07:05 PM
Yes, just seperate the statements with semicolons. Por ejemplo:

<a onclick="img1.src = 'img2.jpg';img3.src = 'img4.jpg';">

jscheuer1
09-18-2005, 11:02 PM
Yes, just seperate the statements with commasWhat commas?

Twey
09-19-2005, 06:36 AM
Er, semicolons. Sorry. I'm really sliding at the moment >.<

cheri
09-19-2005, 08:47 PM
Thank you! It had to be something simple, eh? I'll try it out now.

cheri
09-19-2005, 08:59 PM
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?

Twey
09-20-2005, 03:19 PM
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:

<input type="text" id="tb1"/>
We would set its background colour like so:

document.getElementById('tb1').style.backgroundColor = "#0000FF";
or its text colour like so:

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.

cheri
10-26-2005, 01:30 PM
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

cheri
10-26-2005, 09:31 PM
Well - I sent the post and then I figured out a way to do it. Problem is fixed! Thanks.