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

Q1348 How can I swap images of different sizes?

You are here: irt.org | FAQ | JavaScript | Image | Q1348 [ previous next ]

Netscape does not resize already rendered images.

What I suggest is that you use a layer as wide as the widest image and as heigh as the heighest and replace the html in that layer when you swap using document.write, or change the source- something like this:

<a href="javascript:;"
onclick="document.layers['imageLayer'].document.open();
document.layers['imageLayer'].document.write('<img src=001.jpg>');
document.layers['imageLayer'].document.close();
return false">next</a>
<a href="javascript:;"
onclick="document.layers['imageLayer'].document.open();
document.layers['imageLayer'].document.write('<img src=002.jpg>');
document.layers['imageLayer'].document.close();
return false">next</A>

<layer name="imageLayer" width=200 height=300>Click to see image</layer>

Testing this in Netscape Navigator 4.7 actually DID resize the layer, interestingly enough...

Feedback on 'Q1348 How can I swap images of different sizes?'

©2018 Martin Webb