Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1388 How can I replace a lower resolution image and some explantaion text with a higher resolution image without the text by clicking on the image?

You are here: irt.org | FAQ | DHTML | Q1388 [ previous next ]

Try the following whioch should work in Netscape Navigator 4.x and Microsoft Internet Explorer 5+:

<script language="JavaScript"><!--
function change(what,by) {
    if (document.layers) {
        document.layers[what].document.open();
        document.layers[what].document.write('<center><img src="' + by + '" width="100" height="100"><\/center>');
        document.layers[what].document.close();
    }
    else if (document.all) {
        document.what.innerHTML = '<center><img src="' + by + '" width="100" height="100"><\/center>';
    }
}
//--></script>

<span id="myLayer" style="position:absolute;">
<center>
<a href="javascript:;" onClick="setTimeout('window.change(\'myLayer\',\'image-01high.gif\')',100)"><img src="image-01.gif" border="0" width="100" height="100"></a>
<br>
Some text
</center>
</span>

©2018 Martin Webb