ba*********@abc.net.au a écrit :
We are code crushing the width of images from 285px to 260 pix.
However we aren't changing the height. we need a bit of javascript
that can make that percentage change to the height as well. Can anyone
please help?
You absolutely do not need to know the height of new display
the browser will automatically resize the image proportionally
<img name="test" src="01.jpg" alt="">
<a href="#" onclick="document.images['test'].width = 200;
return false;">proportionnally resize image to 200px width</a>
However if width AND height of image have been set ...
<img name="test" src="01.jpg" alt="" width=400 height=350>
<a href="#"
onclick="var I = document.images['test'];
var prop = I.height/I.width;
I.width = 200;
I.height = 200*prop;
return false;">
proportionnally resize image to 200px width</a>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date