zoukankan      html  css  js  c++  java
  • setcapture

    setCapture 可以捕获到 移动到浏览器外的鼠标事件。 

    例如拖动过程中,即使鼠标移动到了浏览器外,拖动程序依然可以执行! 

    作用就是把 把鼠标事件 捕获到 当前文档指定的对象! 

    setCapture捕获以下鼠标事件:onmousedown、onmouseup、onmousemove、onclick、ondblclick、onmouseover和onmouseout。 

    使用方法: 
    currentObj.setCapture(); 

    在拖放结束后,应当使用releaseCapture() 来释放鼠标,使用方法: currentObj.releaseCapture(); 

    这是ie 的专有方法,如果要兼容ff ,就要使用captureEvents 和 releaseEvents 

    使用方法 
    window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); 
    window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP); 

    一般来说,当拖动过程中,使用事件冒泡,直接为 document.onmouseover 就可以达到ff 下的效果,不必使用captureEvents 
    releaseEvents 使用方法 window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP); 一般来说,当拖动过程中,使用事件冒泡,直接为 document.onmouseover 就可以达到ff 下的效果,不必使用captureEvents 

  • 相关阅读:
    JS加密库
    异常处理
    uva 10673 Play with Floor and Ceil
    执⾏ Python 程序的三种⽅式----pycharm安装
    第⼀个 Python 程序
    认识 Python
    svg的使用
    elementUI中el-image显示不出来图片?img与el-image的区别
    类型转化与变量
    liunx
  • 原文地址:https://www.cnblogs.com/wuchunlin/p/9944275.html
Copyright © 2011-2022 走看看