Image Swapping

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

I have a few questions here...
If you can't answer these, please refer me to a site or a person who can.
What is the javascript code to have image1.gif be replaced by image2.gif when the mouse moves over image1.gif?

What is the javascript code for mouseover on a table cell to change the cell color?

What is the javascript code for mouseover text color changing?

Would CSS style sheets work better?
Thanks!

Laughing out loud

They have: 383 posts

Joined: Sep 2000

Quote:
What is the javascript code to have image1.gif be replaced by image2.gif when the mouse moves over image1.gif?

There are tons of code snippets for this. If you have DreamWeaver read the dynamic functions (behaviors) tutorial. It’s very easy to do with DreamWeaver. The primary thing to remember is that the coding is basically the same no matter what image your swapping. The only difference is the name of the image you want to replace.

Quote:
What is the javascript code for mouseover on a table cell to change the cell color?

This only works in IE (it probably works in Netscape 6 also) so I usually do this by using images rather then tables. However you can find a JavaScript for IE at http://www.dynamicdrive.com/dynamicindex11/highlighttable.htm. There are also other ways to do it. I believe there’s a fairly complex tutorial at The Microsoft Developer Site.

Quote:
What is the javascript code for mouseover text color changing? Would CSS style sheets work better?

It can be done a few different ways. One way would be:

-------------------------------------------------------

Link to TWF

-------------------------------------------------------

Another way would be using StyleSheets:

-------------------------------------------------------

TITLE

Link to TWF

-------------------------------------------------------

There are also ways to use CSS on particular links. Take a look at a good CSS tutorial for more information. Webmonkey.com has quite a few.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.