Skip to content

Instantly share code, notes, and snippets.

@eeejay
Created April 12, 2018 22:46
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 eeejay/9d87f9fdad9b22e64edb028e6ea2c030 to your computer and use it in GitHub Desktop.
Save eeejay/9d87f9fdad9b22e64edb028e6ea2c030 to your computer and use it in GitHub Desktop.
function showClientCoords(win, x, y, timeout=1000) {
let d = win.document.createElement("div");
d.style.width = "10px";
d.style.height = "10px";
d.style.borderRadius = "5px";
d.style.backgroundColor = "red";
d.style.position = "fixed";
d.style.top = (y + 5) + "px";
d.style.left = (x + 5) + "px";
win.document.documentElement.appendChild(d);
win.setTimeout(function() {
d.remove();
}, timeout);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment