Created
December 16, 2014 22:23
-
-
Save lmullen/1129f11f06ed7c282644 to your computer and use it in GitHub Desktop.
Simple counter
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> | |
#counter { | |
width:100%; | |
height:100%; | |
font-size:400px; | |
text-align:center; | |
padding-top:40px; | |
overflow:hidden; | |
} | |
::selection { | |
background: transparent; | |
} | |
body { | |
overflow:hidden; | |
} | |
</style> | |
<div id="counter">0</div> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script> | |
var counter = d3.select("#counter") | |
counter.on("click", count); | |
var val = 0; | |
function count() { | |
val++ | |
counter.text(val); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment