/ Published in: Other
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function ResizeImage(image, maxwidth, maxheight) { if (image.className == "Thumbnail") { w = image.width; h = image.height; if( w == 0 || h == 0 ) { image.width = maxwidth; image.height = maxheight; } else if (w > h) { if (w > maxwidth) image.width = maxwidth; } else { if (h > maxheight) image.height = maxheight; } image.className = "ScaledThumbnail"; } }