复制代码代码如下:
<SCRIPT Language="JavaScript">
функция DrawImage(ImgD,FitWidth,FitHeight){
вар изображение = новое изображение ();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
if(image.width/image.height>= FitWidth/FitHeight){
если (image.width> FitWidth) {
ImgD.width = FitWidth;
ImgD.height=(image.height*FitWidth)/image.width;
}
еще{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
еще{
если (image.height> FitHeight) {
ImgD.height=FitHeight;
ImgD.width=(image.width*FitHeight)/image.height;
}
еще{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
}
</скрипт>
Источник:
复制代码代码如下:
<a href="admin/<? echo $rscase['path']?>" target="_blank"><img src="admin/<? echo $rscase['path']?>" onload='javascript :DrawImage(this,180,);' hspace="3" vspace="3" /></a>