?崇?ㄥ??????琚?锛?????琚?澶瑰?锛?????绾哥??_涓?娴锋ˉ??璐告??????????/title>
function AutoResizeImage(maxWidth,maxHeight,objImg){
var img = new Image();
img.src = objImg.src;
var hRatio;
var wRatio;
var Ratio = 1;
var w = img.width;
var h = img.height;
wRatio = maxWidth / w;
hRatio = maxHeight / h;
if (maxWidth ==0 && maxHeight==0){
Ratio = 1;
}else if (maxWidth==0){//
if (hRatio<1) Ratio = hRatio;
}else if (maxHeight==0){
if (wRatio<1) Ratio = wRatio;
}else if (wRatio<1 || hR
来源: www.qx5147.com
收录时间: 2026-12-02 04:15:04
阅读量: 1