We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
The community reviewed whether to reopen this question 2 years ago and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
我不知道有一个预先打包的通用解决方案可以一键解决这个问题。
我建议选择一个好的 Javascript 框架(我个人最喜欢的是 MooTools,但是 jQuery 也很好)。这两个库都提供了以跨浏览器兼容的方式处理鼠标事件的更好方法。
我的建议:
保留通过 AJAX 调用不断推送到服务器的鼠标事件队列。响应 AJAX 请求的服务器端脚本可以将数据推送到您选择的数据库中。
看一下这个漂亮的 MooTools 库,用于处理高级鼠标手势,以便更好地了解如何完成鼠标移动记录:Moousture。
编辑:
经过一番谷歌搜索后,我还发现了一个 MooTools 手电筒效果,它几乎完全符合你的要求。您可以将坐标存储在稍后推送到服务器的队列中,而不是根据鼠标移动来更新手电筒的位置。
I don't know that there is a pre-packaged general solution to this problem one-click away.
I would recommend picking a good Javascript framework (my personal favorite is MooTools, but jQuery is nice too). Both of these libraries provide nicer ways of handling mouse events in a cross-browser compatible manner.
My advice:
Keep a queue of mouse events that you constantly push to a server via AJAX calls. The server-side script that answers the AJAX request can push the data into a database of your choosing.
Take a look at this nice MooTools library for handling advanced mouse gestures to get a good feel of how you might accomplish the mouse movement recording: Moousture.
Edit:
After a little more Googling I also came across a MooTools Flashlight Effect which does almost exactly what you want. Instead of updating the position of the flashlight based on mouse movement, you would store the coordinates in a queue that gets pushed to a server later.