Skip to content

Commit

Permalink
Added a button.
Browse files Browse the repository at this point in the history
  • Loading branch information
samdk committed Aug 21, 2010
1 parent c13d804 commit 1c31cc8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions index.html
Expand Up @@ -9,6 +9,7 @@
</head>
<body>
<canvas id="c" width="200" height="200"></canvas>
<a href="#" id="button">Draw</a>
</body>
</html>

4 changes: 2 additions & 2 deletions script.js
@@ -1,6 +1,6 @@
$(function() {
$("#button").live("click",refresh);
}
});

function refresh() {
var canvas = document.getElementById('c'),
Expand All @@ -27,4 +27,4 @@ function refresh() {
ctx.putImageData(canvasData,0,0);
}
draw();
})
}
15 changes: 12 additions & 3 deletions style.css
@@ -1,10 +1,19 @@
body {
background: black;
color: white;
}
canvas {
margin: 200px auto;
margin: 200px auto 0;
display: block;
border: 3px solid #999;
padding: 3px;
padding: 10px;
background: white;
}
a {
display: block;
background: white;
padding: 10px 20px;
color: black;
margin: 10px auto;
width: 40px;
text-align: center;
}

0 comments on commit 1c31cc8

Please sign in to comment.