鼠标滑轮控制图片放大缩小

来源:互联网 发布:我的祖国 龙应台 知乎 编辑:程序博客网 时间:2024/03/29 05:26

 

<script language="JavaScript">
<!--
//改变图片大小
function resizepic(thispic){
 if(thispic.width>700) thispic.width=700;
}
//无级缩放图片大小
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>

<img src="<%=pro_pic%>"   onload="javascript:resizepic(this)" onmousewheel="return bbimg(this)"/>

 


原创粉丝点击