TomSun

享受编程的快乐!Attitude is everything!

导航

利用鼠标中键缩放图片

Posted on 2005-09-26 10:27  TomSun  阅读(544)  评论(0编辑  收藏  举报
<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>