releaseEvents也好像没用
设置了也没效果

解决方案 »

  1.   

    还有就是想知道ie和ff鼠标捕获的区别
    感觉ff的鼠标捕获相当于ie的document.body.setCapture(false)
    但ff又做不到ie的这个效果
    <html>
    <body onclick="alert(2)">
    <script>document.body.setCapture(false);</script>
    </body>
    </html>
      

  2.   

    captureEvents
    这东西貌似在DOM2里废弃了..FF默认就有鼠标捕获用不着它.....
    并且它好象是捕获事件的...那流程不了解...那东西貌似是好老的版本才用到,那时候还没做过兼容...:D反正没用就对了...
    IE不是默认鼠标捕获所以要手动来下...就是[set/release]Capture
    onlosecapture
      

  3.   

    没用的东西就不管了再问问
    <html>
    <body>
    <div id="aa"></div>
    <script>
    document.onmousemove=function(){aa.innerHTML+=1;}
    aa.setCapture();
    </script>
    </body>
    </html>这里一般的鼠标移动只有浏览器内有效
    但如果按住鼠标拖的话就能整个屏幕都有效
    为什么呢
      

  4.   

    Warning: Use of captureEvents() is deprecated, see bug 330494this reports a forward compatibility problem but, at the moment, it's just annoying to see all those logs in the console.some more info gathered from firefox dev lists:====The supported events did not change, it's just that using the
    non-standrard window.captureEvents method to listen for events will
    break in the next version of Gecko (1.9 - the engine for Firefox 3).You should use the W3C events API instead - specifically
    addEventListener. There are quite a few documents and tutorials
    explaining the W3C events system, read some of them (I like the
    explanation and the illustration in the DOM Level 3 Events draft).Even though W3C DOM Level 2 Events specification doesn't have a key
    event module, Gecko supports the usual key events, 'keypress'
    included.Documentation is available on MDC
    (http://developer.mozilla.org/en/docs/Gecko_DOM_Reference ), but some
    of its pages are not of good enough quality yet, so be careful. Once
    you figure something out, you're welcome to improve the docs. The W3C
    specifications are a good source of information too, except for the
    places where we don't follow the spec. 
      

  5.   

    还有就是ff貌似没有类似losecapture的事件
      

  6.   


    设置了SetCapture,所有鼠标的操作都会在调用该函数的窗口处捕捉到,包括该窗口以外的鼠标操作,你可以看到SetCapture有一个HWND类型的参数(API原型),就是标识这个窗口的,如果不执行这个函数你是捕捉不到窗口以外的操作的,相对应的,ReleaseCapture就是解除这种设定。
      

  7.   


    不是这个意思
    你说的我当然知道了
    我说的是setCapture后不按住鼠标和按住鼠标的情况
      

  8.   

    我记得整个从鼠标按下和鼠标抬起是在一个消息循环中进行的。
    也就是说你只有在mouseup之前都是在IE控件的消息循环中进行的。
    不过如果你没有设置setCapture的话,
    消息会被派发出去给别的窗口。
      

  9.   

    看看windows的消息处理机制就会明白了。
    C++程序员会经常接触这些。
      

  10.   

    简单的说,
    mousedown, mouseup, mousemove本来都是在一个循环中进行的,
    它始于mousedow,终止于mouseup。
    系统的消息处理是根据的坐标,
    将消息传递给坐标位置最上层的窗口对象,
    再由这个对象将消息向下进行传递。
    如果不设置setCapture,
    在鼠标移出对象后,
    会将消息发送给别的对象。
      

  11.   

    说实话没看明白但看这里
    <html>
    <body>
    <div id="aa" onMouseMove="aa.innerHTML+=1;" onmousedown="alert(1)"></div>
    <script>
    aa.setCapture();
    </script>
    </body>
    </html>在浏览器外onMouseMove没效果
    但onmousedown就能触发
    这又怎么解析
      

  12.   

    还想问问muxrwc 
    你在http://www.never-online.net/blog/article.asp?id=192
    说貌似ie的window blur和 FF,OP的window blur还有不同
    IE是返回页面时才检测到
    这个什么意思我试了一下
    <html>
    <body>
    <script>
    window.onblur=function(){alert(1)};
    </script>
    </body>
    </html>结果ff不断弹出alert
    ie只弹一个
    难道ff没有对alert进行阻塞??
    我想这个就是上次我问你的那个关于多线程的问题所在
      

  13.   

    msdn中关于setCapture说
    Mouse clicks automatically trigger the onlosecapture event.
    大概意思是鼠标点击自动触发onlosecapture事件
    鼠标点击就会触发????好像不是吧
      

  14.   

    <html> 
    <body onclick="alert(2)"> 
    <script>document.body.setCapture(false); </script> 
    </body> 
    </html>
      

  15.   


    ff里window.onblur等同lose....
      

  16.   


    说貌似ie的window blur和 FF,OP的window blur还有不同 
    IE是返回页面时才检测到 
    这个什么意思 
      

  17.   

    忘了...
    反正ie8还是ie6来着...
    blur是在再次获得焦点时才会触发....
    所以用了lose
    否则就统一用blur了...有鼠标捕获移动到窗口外是不会触发它的
    所以触发了它就丢失了鼠标捕获....
    这样移动到窗口外也就不会触发up了...:D
    我那个D类里全有处理的说...
    http://www.cnblogs.com/muxrwc/archive/2008/07/17/1244998.html
      

  18.   

    <html>
    <body>
    <div id="aa" onMouseMove="aa.innerHTML+=1;" onmousedown="alert(1)"></div>
    <script>
    aa.setCapture();
    </script>
    </body>
    </html>
    那为什么这里
    在浏览器外onMouseMove没效果 
    但onmousedown就能触发 
    为什么呢
      

  19.   

    在非IE下用captureEvents(Event.MOUSEMOVE | Event.MOUSEUP),确实没有什么效果!
    郁闷!!