Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IMG swap changing 2 IMG's?

Status
Not open for further replies.

Cadwalader

IS-IT--Management
Feb 12, 2002
297
US
Greetings!

I am having some trouble with getting a client side image swap to change two images at the same time, in two different cells in a table. I know it can be done with JS, but I am scripti-capped, and JS just blows my mind. Help?

--Rich
 
Add "name" property to both images (let's say "one" and "two"):
<img src=&quot;..&quot; name=&quot;one&quot; width=&quot;&quot; heigth=&quot;&quot; alt=&quot;&quot;>
and then do this:

document.images['one'].src = 'one_new.gif';
document.images['two'].src = 'two_new.gif';

Put this into separate function and call it when needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top