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

Q1348 How can I swap images of different sizes?

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

Q1348 How can I swap images of different sizes?

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?'


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.