图片鼠标缩放 并限定显示大小

<SCRIPT language=JavaScript type=text/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>

调用方法

<img src="<%=request.getContextPath()%>/photo.khtml?action=down&type=800&id=<bean:write name="fid"/>"
 onmousewheel="return img_zoom(event,this)" onload="javascript:if(this.width>screen.width-300)this.width=screen.width-300"/ >

你可能感兴趣的:(JavaScript,bean)