CodeAs follows:
What I do is to control the proportion under a certain width, which is applicable to the general situation. For special control, you can just think differently.
<Script language = "JavaScript" type = "text/JavaScript">
// Reset the image size
VaR imgc = Document. getelementbyid ("imgc ");
VaR limitwidth = 570;
VaR imgarr = imgc. getelementsbytagname ("IMG ");
For (VAR I = 0; I {
VaR imgobj = imgarr [I];
Imgobj. onload = function ()
{
If (this. width)
{
VaR orazw = This. width;
VaR orazh = This. height;
If (orazw> limitwidth)
{
// This. rel = "lightbox ";
This. width = limitwidth;
This. Height = (this. Width * orazh)/orazw;
This. Title = "click to view the large image ";
This. style. cursor = 'hand ';
This. onclick = function () {var Mw = showbigimg ("imgshow. aspx", this. SRC, window. Screen. availWidth-100, window. Screen. availHeight-100 );}
}
}
}
}
</SCRIPT>