直接好象不行吧?我知道的只能判断鼠标左右键。不知道这样行不行,在鼠标左键按下以后为为设置window的
onscorll函数只要函数执行应该就是按下左键后滚动滚轮了

解决方案 »

  1.   

    FF 不支持多键同时按下的捕捉你可以去 x-bs.com 的扫雷里看下源文件
      

  2.   

    <script>
    //ff没测试过,ff按键值和ie表示不同
    var FirstButton=null;
    document.onmousedown=function(e)
    {
    e=e||event;
    if(FirstButton==null)
    {
      FirstButton=e.button;//记住第一次按下的鼠标键
    }
    else
    {
    if(FirstButton==1&&e.button==5)
      alert('按下了左键后按下滚轮!');
    }
    }
    document.onmouseup=function(){FirstButton=null;}
    </script>
      

  3.   

    <div id="dvState">
    <script>
    var st=null;
    var top=null;
    document.onmousedown=function(e)
    {
    e=e||event;
    if(e.button==1)
    {
    top=document.body.scrollTop;
    st=setInterval(checktop,50);
    }
    }
    document.onmouseup=function(){if(st)clearInterval(st);}
    function checktop()
    {
    if(document.body.scrollTop>top)
      window.status="按下左键并且向下滚动";
    else if(document.body.scrollTop<top)
      window.status="按下左键并且向上滚动";
    //else window.status="";
    top=document.body.scrollTop;
    }
    </script>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>1
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br<br>2
      

  4.   

    那没办法了,好象没有判断滚轮方向的事件就算是window.onscroll也是要页面能滚动
      

  5.   

    function gd(evt){ 
    evt=evt?evt:event; 
    if (event.wheelDelta<120) {
      if (event.button==1){
        alert("按下向下");
      }else {
        document.getElementById('_xia').click();
      }
    }
    else {
       if (event.button==1){
          alert("按下向上");
       }else {
          document.getElementById('_sh').click();
       }
     }
    }我这样写的话,在松开鼠标的时候。鼠标的状态还是处于按下状态。
      

  6.   

    原来我这个方法是对的。。谢谢showbo