Created
April 12, 2018 22:46
-
-
Save eeejay/9d87f9fdad9b22e64edb028e6ea2c030 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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