javascript - 检测用户鼠标在浏览器内外的移动
问题描述
我想通过跟踪鼠标事件来检测用户是否不使用他的计算机?你知道如何使用 JQuery 或 Javascript 来实现这一点吗?
解决方案
Not sure tracking mouse movements outside the browser is possible. You track this type of thing by using event listeners and mounting the listener to an html element. in your case you would mount a mousemove
listener to the window to track movement across the whole page. But outside of the browser window their is nothing that JS can mount an event listener to their for leaving no option to track mouse movement outside the browser. (could be wrong though, seems creepy if its possible)
推荐阅读
- html - 想在 div 元素中居中一个 href 元素
- xcode11 - iOS 13 中的 ATS 策略是否已更改并且允许任意加载现在不起作用?
- java - JDBC 事务未回滚 - setAutoCommit(false)
- delphi - Delphi 数组构造函数替代
- python - Pyinstaller 缺少引导加载程序
- c# - 如何使用带有 FakeConnectionFactory 类的 AsyncEventingBasicConsumer (rabbitmq - c#) 对消费者应用单元测试?
- javascript - 根据标头值返回 json 对象
- java - 使用 CL 或 RPGLE 在 IBM i 上以编程方式检查 java 版本
- android-studio - Android Studio / IDEA 接受提示无括号
- rpa - 在 UI 路径中的 Add Datarow 活动中未添加值