复制番号代番号次のように:
<SCRIPT言語="JavaScript">
関数 DrawImage(ImgD,FitWidth,FitHeight){
var image=新しい画像();
画像.src=ImgD.src;
if(image.width>0 && image.height>0){
if(image.width/image.height>= FitWidth/FitHeight){
if(image.width>FitWidth){
ImgD.width=フィット幅;
ImgD.height=(image.height*FitWidth)/image.width;
}
それ以外{
ImgD.width=画像.幅;
ImgD.高さ=画像.高さ;
}
}
それ以外{
if(image.height>FitHeight){
ImgD.height=フィット高さ;
ImgD.width=(image.width*FitHeight)/image.height;
}
それ以外{
ImgD.width=画像.幅;
ImgD.高さ=画像.高さ;
}
}
}
}
</script>
使用方法:
复制番号代番号次のように:
<a href="admin/<? echo $rscase['path']?>" target="_blank"><img src="admin/<? echo $rscase['path']?>" onload='javascript :DrawImage(this,180,);' hspace="3" vspace="3" /></a>