Created
June 26, 2018 19:37
-
-
Save Mosquid/5500b3cf08c3f82d9599b8e5e8fabb20 to your computer and use it in GitHub Desktop.
Events
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() { | |
var event = new Event('poop') | |
var clicked = 0 | |
document.body.addEventListener('click', function() { | |
clicked++ | |
if (clicked > 1) { | |
clicked = 0 | |
document.body.dispatchEvent(event) | |
} | |
}) | |
}()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`
<title>Events Demo</title> <style> html, body {height: 100%;} </style> <script src="fns.js"></script> <script> function myConsole() { console.log('test'); } `