JS:图片等比例缩放
// 等比例缩放 var bili = 1; if (imgWidth > imgHeight && imgWidth > 400) { bili = imgWidth / 400; imgWidth = 400; imgHeight = imgHeight / bili; } else if (imgWidth < imgHeight && imgHeight > 300) { bili = imgHeight / 300; imgHeight = 300; imgWidth = imgWidth / bili; }
本文来自博客园,作者:huiy_小溪,转载请注明原文链接:https://www.cnblogs.com/huiy/p/12395915.html