View Full Version : Resize image down....only if larger than 400 pixels?

06-20-2004, 11:27 PM

I am looking for some assistance if anyone would be willing to offer some.

I need to write a javascript to resize an image down to 400 pixels in width....but only if the image is greater than that value.

If the image is smaller than 400 pixels, I don't want it to resize. I'm sure this is simple and I'm hoping someone may be able to point me in the right direction.

Mr J
06-21-2004, 12:05 AM
Do you mean something like this

<TITLE>Document Title</TITLE>

function test(){

<BODY onload="test()">

<img name="mypic" src="pic.jpg">

06-22-2004, 07:52 AM
Yes.....that does exactly what I was hoping.

Thank you very much