Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

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.write('<center><img src="' + by + '" width="100" height="100"><\/center>');
    else if (document.all) {
        document.what.innerHTML = '<center><img src="' + by + '" width="100" height="100"><\/center>';

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

©2018 Martin Webb