How to capture the coordinates of your mouse as it moves along a path with jQuery
When you want to move an object on your web page, you can do so by setting the top and left property of that object to several screen coordinates along a path of travel. Although you can create those coordinates by hand, it is more efficient to capture those coordinates using your mouse.
Previously, I had discussed:
- How to use jQuery to detect mouse clicks and
- How to use jQuery to get mouse cursor coordinates when mouse moves
In this post, we extend those ideas to build a simple mechanism that captures the coordinates of your mouse as it moves alone a path.
Follow us