Last active
April 7, 2019 10:23
-
-
Save dorukcan/72aa852e2af576ddd4cfe84428af2e8b 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
var horizontal_line = document.createElement('div'); | |
horizontal_line.setAttribute('style', ` | |
position: absolute; | |
left: 0px; | |
top: 0; | |
width: 1px; | |
height: 100%; | |
background-color: red; | |
z-index: 999999; | |
`); | |
document.body.appendChild(horizontal_line); | |
document.addEventListener("mousemove", function(e) { | |
horizontal_line.style.left = (e.clientX - 1) + 'px'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment