onwheele事件 里判断力一下焦点是不是在MP上?

解决方案 »

  1.   

    onmousewheel  鼠标中键滚动事件
    <img id=pic src="http://community.csdn.net/images/CSDN_logo.GIF" 
    border=0 onmousewheel="return zoomimg(this)" alt="鼠标滚轮放大/缩小图片">
    <script>
    var zoomp = 92;
    function zoomimg(img)
    {
      var zoom = parseInt(img.style.zoom,10) || 100;
      zoom += event.wheelDelta / 12;
      if (zoom>10) img.style.zoom = zoom + "%";
      return false;
    }
    </script>
      

  2.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function show(){
    event.wheelDelta>0?document.body.innerText-=-1:document.body.innerText-=1;
    }//-->
    </SCRIPT>
    <body onmousewheel="show()">
    1