【ps怎么缩放图片】图片缩放脚本

更新时间:2015-01-10    来源:网页配色    手机版     字体:

【www.bbyears.com--网页配色】

用法:
DrawImage(ImgD,imgwidth) ImgD 为 图片标签的 name imgwidth为图片允许的最大宽度
以下是引用片段:
<% Response.Write "" %> 
<script language="javascript"> 
var flag=true;  
function DrawImage(ImgD,imgwidth){  
     var image=new Image();  
     image.src="/blog/ImgD.src";  
     if(image.width>0 && image.height>0){  
         flag=true;  
         if(image.width>=imgwidth){  
             ImgD.width=imgwidth;  
             ImgD.height=(image.height*imgwidth)/image.width;  
         }else{  
             ImgD.width=image.width;  
             ImgD.height=image.height;  
         }   
     }  
}  
function cgimg(o){ 
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0)  
o.style.zoom=zoom+’%’; 
return false; 

</script> 

 

本文来源:http://www.bbyears.com/wangyezhizuo/12100.html

猜你感兴趣