HTML and CSS Reference
In-Depth Information
// Create ball
y += speed;
context.fillStyle = "#000000";
context.beginPath();
context.arc(x,y,15,0,Math.PI*2,true);
context.closePath();
context.fill();
}
theCanvas = document.getElementById("canvasOne");
context = theCanvas.getContext("2d");
var speed = 5;
var y = 10;
var x = 250;
setInterval(drawScreen, 33);
}
</script>
</head>
<body>
<div style="position: absolute; top: 50px; left: 50px;">
<canvas id="canvasOne" width="500" height="500">
Your browser does not support HTML5 Canvas.
</canvas>
</div>
</body>
</html>
The basic structure of the HTML for all of the examples in this chapter
will follow these rules. In the interest of saving space, we will refrain
from discussing this code further, but it will appear in the examples
provided.
Search WWH ::




Custom Search