It means to control the size of the image in the designated area, or some larger advertisements The picture will also be distorted.
function controlImg(ele,w,h){
var c=ele.getElementsByTagName("img");
for(var i=0;i
var w0=c[i].clientWidth,h0=c[i].clientHeight;
var t1=w0/w,t2=h0/h;
if(t1> 1||t2>1||w0>=600){
c[i].width=Math.floor(w0/(t1>t2?t1:t2));
c[i].height =Math.floor(h0/(t1>t2?t1:t2));
if(document.all){
c[i].outerHTML='' c[i].outerHTML ''
}
else{
c[i] .title="Open image in new window";
}
ele is the specified area, w is the maximum width, if it is larger than this, it will be reduced. h is the maximum height.