I am implementing a scrollbar using jQuery/Javascript/CSS. The usual. Everything is going according to plan except for the following use case:

我正在使用jQuery / Javascript / CSS实现滚动条。通常。除了以下用例之外,一切都按计划进行:

The user mouses down in the scrollbar div hosting mousedown/mousemove/mouseup event handlers. The user initiates a drag gesture - mousemove starts firing - that soon moves the cursor outside the bounds of the scrollbar div and onto the surrounding div real estate on the web page. The moment this happens, mousemove - as expected - stops firing events.

用户将鼠标停留在托管mousedown / mousemove / mouseup事件处理程序的滚动条div中。用户启动拖动手势 - mousemove开始触发 - 很快将光标移动到滚动条div的边界之外,并移动到网页上的周围div房地产上。一旦发生这种情况,mousemove-正如预期的那样 - 停止触发事件。

How do I continue to have mousemove fire events without resorting to just attaching a mousemove handler to the root div? How do I maintain scrollbar dragger translation even though the cursor has wandered off the scrollbar?

如何在不诉诸于将mousemove处理程序附加到根div的情况下继续使用mousemove fire事件?即使光标从滚动条上移开,如何保持滚动条拖动器转换?

Thanks,
Doug

1 个解决方案

#1


0

Instead of using onmousemove on the element, use it on the document.

而不是在元素上使用onmousemove,在文档上使用它。

更多相关文章

  1. Github推送事件签名不匹配
  2. 在鼠标悬停事件中使用Javascript隐藏内容
  3. 谷歌Chrome复制了JavaScript的“焦点”事件
  4. js“DOM事件”之鼠标事件、js的测试方法、js代码的放置位置
  5. 使用angularjs添加包含事件的新标记
  6. jqGrid 数据加载完事件 loadComplete 使用
  7. JavaScript - 检测click事件是否触发了DOMNodeInserted事件
  8. Jquery中动态添加元素的绑定事件不起作用
  9. 我可以使用onBlur事件对TextBox进行日期检查吗?

随机推荐

  1. XML入门教程:XSLT-XML/XSLT的代码实例
  2. .net读写xml文档详解
  3. XML中的DTD文档类型定义完全解析的示例代
  4. php解析xml方法实例(附代码)详细说明
  5. XML入门教程:详细介绍XHTM模块
  6. 浅谈WEB页面工具语言XML(四)应用分类
  7. xml语法详细说明
  8. XML入门教程:XLink-XML/XSLT的具体分析
  9. 浅谈WEB页面工具语言XML(三)支持工具
  10. 分享.net 操作xml的简单方法及说明