ASP calls the size of the picture
function Resizeimage (imageid,limitwidth,limitheight)
{
var image = new Image ();
IMAGE.SRC = IMAGEID.SRC;
if (image.width <= 0 && image.height <= 0) return;
if (image.width/image.height >= limitwidth/limitheight)
{
if (Image.width > Limitwidth)
{
Imageid.width = Limitwidth;
Imageid.height = (image.height*limitwidth)/image.width;
}
}
else if (Image.height > Limitheight)
{
Imageid.height = Limitheight;
Imageid.width = (image.width*limitheight)/image.height;
}
if (imageid.parentElement.tagName!= "A")
{
Imageid.onclick = function () {window.open (THIS.SRC);}
Imageid.style.cursor = "Hand";
}
}
Window.onload = initimages;
function Initimages ()
{
The constraint width and height of the picture
var maxwidth = 100;
var maxheight = 100;
var IMGs = document.getelementsbytagname ("img");
for (Var i=0 i < imgs.length; i++)
{
var img = IMGs;
if (img.width>maxwidth| | Img.height>maxheight)
Resizeimage (IMG, maxwidth, maxheight);
}
}