You are here: irt.org | FAQ | DHTML | Q578 [ previous next ]
In Internet Explorer 4 and Netscape Navigator 4 you can make layers visible, with perhaps one containing a different sozed image:
<form>
<input type="button" value="show" onClick="show()">
</form>
<span>
<span id="image1" style="position:absolute; width:300; height:200;">
<img src="jnc1.gif" width="10" height="10">
</span>
<span id="image2" style="position:absolute; width:300; height:200; visibility:hidden">
<img src="jnc1.gif" width="100" height="100">
</span>
</span>
<script type="text/javascript" language="JavaScript"><!--
function show() {
if (document.all) document.all('image2').style.visibility = 'visible';
else if (document.layers) document.layers['image2'].visibility = 'visible';
}
//--></script>In Internet Explorer 5 and Netscape Navigator 6 you can resize an image by amending its width and height properties. This could be used just after you swap an image to resize it to your preferred dimensions.