[JavaScript]鼠标滚轮缩放图片

<html>
<script language="javascript">
function img_zoom(e, o)  //图片鼠标滚轮缩放
{
var zoom = parseInt(o.style.zoom, 10) || 100;
zoom += event.wheelDelta / 12;
if (zoom > 0) o.style.zoom = zoom + '%';
  return false;
}
</script>JetKing 51cto技术博客
<body bgcolor="#fef4d9" onLoad="init()">
 <DIV ID=plane3>
<IMG img_zoom(event,this)" onload="javascript:if(this.width>screen.width-333) this.width=screen.width-333;if(this.width>600) this.width=600" src="图片路径" border="0">
</DIV></body>
</html>

你可能感兴趣的:(JavaScript,职场,图片缩放,休闲,鼠标事件)