made with requirebin
Created
December 22, 2014 01:34
-
-
Save olivierrr/6d6eb62eedfe614dc5d9 to your computer and use it in GitHub Desktop.
requirebin sketch
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 timer = null | |
elem.addEventListener('click', function(){ | |
if(timer) { | |
clearTimeout(timer) | |
doStuff() | |
} | |
else timer = setTimeout(doStuff, 3000) | |
}) | |
function doStuff(){ console.log('111') } |
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
undefined;var timer=null;elem.addEventListener("click",function(){if(timer){clearTimeout(timer);doStuff()}else timer=setTimeout(doStuff,3e3)});function doStuff(){console.log("111")} |
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
{ | |
"name": "requirebin-sketch", | |
"version": "1.0.0" | |
} |
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
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; } | |
body, html { height: 100%; width: 100%; }</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment