function qmd_size(that){ var new_width=436; var new_height=200; var src_width=that.width; var src_height=that.height; if (src_width>new_width || src_height>new_height){ var radio=Math.max((src_width/new_width),(src_height/new_height)); var width=Math.ceil(src_width/radio); var height=Math.ceil(src_height/radio); that.width=width; that.height=height; }return{ width:width, //宽 height:height //高 } }
|