现在的位置: 首页 > 综合 > 正文

利用鼠标中键缩放图片

2012年08月02日 ⁄ 综合 ⁄ 共 464字 ⁄ 字号 评论关闭
<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>

抱歉!评论已关闭.