>>none that I know of.  if you have a method, feel free ot let me know.
>>
>I've done something similar before - I'll try to find some example code from 
>work today.  I've only tried it in IE though - not sure if it is standard 
>stuff that would work in any browser.
>
I thought about this some more, and knocked up a quick little test.  After 
loading an image, examine the image width and if it's over some max size, scale 
the image down:

<html>
<head>
<script language="Javascript">
function resize(src)
{
        if (src.width > 200)
        {
                src.width = 200;
        }
}
</script>
</head>
<body >
The following image is small...<BR>
<img src="http://www.slimdevices.com/images/platinum200.gif"";><BR>
...and therefore onLoad event will not scale it.<BR>
<img src="http://www.slimdevices.com/images/platinum200.gif"; 
onLoad="resize(this)"><BR>
<BR>
<HR>
The following image is larger...<BR>
<img src="http://www.slimdevices.com/images/hero_image_03.gif";><BR>
...and therefore onLoad event will scale it.<BR>
<img src="http://www.slimdevices.com/images/hero_image_03.gif"; 
onLoad="resize(this)"><BR>
</body>
</html>

Phil
_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/beta

Reply via email to