Skip to content

Instantly share code, notes, and snippets.

@gaelollivier
Created June 7, 2016 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaelollivier/a4d260eb867cbfe9c84cb97156001a20 to your computer and use it in GitHub Desktop.
Save gaelollivier/a4d260eb867cbfe9c84cb97156001a20 to your computer and use it in GitHub Desktop.
Track mouse position (useful for e2e debugging, for example)
<div id="mouse" style="width:10px; height: 10px; background: red; position: absolute;"></div>
<script type="text/javascript">
setTimeout(function () {
var $ = jQuery;
$(document).mousemove(function (e) {
$('#mouse').css({ top: e.clientY + 1, left: e.clientX + 1});
});
}, 1000);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment