Skip to content

Instantly share code, notes, and snippets.

@lmullen lmullen/index.html
Created Dec 16, 2014

Embed
What would you like to do?
Simple counter
<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
You can’t perform that action at this time.