滑轮改变图片大小

来源:互联网 发布:win10下装centos 编辑:程序博客网 时间:2024/04/28 03:43

<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>  
   
  然后  
  <img   src='14de99aa-e1d6-4631-9713-90590831197c.png'   onload="javascript:if(this.width>screen.width*0.7)this.style.width=screen.width*0.7;"   onmousewheel="return   bbimg(this)">

原创粉丝点击