Image Swapping
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!
Adam Oberdorfer posted this at 03:55 — 6th June 2001.
They have: 383 posts
Joined: Sep 2000
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.
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.
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.