Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1134 How can I swap one image to the same highlighted image over many different links?

irt.org | Knowledge Base | JavaScript | Image | Q1134 [ previous next ]

Q1134 How can I swap one image to the same highlighted image over many different links?

Try:

<script language="JavaScript"><!--
function swapOn() {
    if (document.images)
        document.imageName.src='image2.gif'
}

function swapOff() {
    if (document.images)
        document.imageName.src='image1.gif'
}
//--></script>

<img src="image1.gif" name="imageName" width="100" height="100">

<a href="page1.htm" onMouseOver="swapOn()" onMouseOut="swapOff()">text link 1</a>
<a href="page2.htm" onMouseOver="swapOn()" onMouseOut="swapOff()">text link 2</a>
<a href="page3.htm" onMouseOver="swapOn()" onMouseOut="swapOff()">text link 3</a>
<a href="page4.htm" onMouseOver="swapOn()" onMouseOut="swapOff()">text link 4</a>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.