利用鼠标中键缩放图片

< html >
< head >
< meta  http-equiv ="Content-Type"  content ="text/html; charset=gb2312" >
< title > 利用鼠标中键缩放图片 </ title >
< script  language ="JavaScript" >
function bbimg(o){
    
var zoom=parseInt(o.style.zoom, 10)||100;
    zoom
+=event.wheelDelta/12;
    
if (zoom>0
        o.style.zoom
=zoom+'%';
        
return false;
}

</ script >
</ head >

< body >
< center >< img  src ="uploadfile/2005115214625668.JPG"  onload ="if(this.width>200)this.width=200"  onmousewheel  = "bbimg(this);" ></ center >
</ body >
</ html >

你可能感兴趣的:(利用鼠标中键缩放图片)