Copy Code code as follows:
<script language= "JavaScript" >
function DrawImage (imgd,fitwidth,fitheight) {
var image=new image ();
IMAGE.SRC=IMGD.SRC;
if (image.width>0 && image.height>0) {
if (image.width/image.height>= fitwidth/fitheight) {
if (image.width>fitwidth) {
Imgd.width=fitwidth;
imgd.height= (image.height*fitwidth)/image.width;
}
else{
Imgd.width=image.width;
Imgd.height=image.height;
}
}
else{
if (image.height>fitheight) {
Imgd.height=fitheight;
Imgd.width= (image.width*fitheight)/image.height;
}
else{
Imgd.width=image.width;
Imgd.height=image.height;
}
}
}
}
</script>
Call Method:
Copy Code code as follows:
<a href= "ADMIN/<? echo $rscase [' Path ']?> "target=" _blank "> ' alt=] Click to enlarge the picture "width=" 180 "height=" 180 "onload=" Javascript:drawimage (this,180,); ' Hspace= ' 3 "Vspace=" 3 "border=" 0 "/></a>