CanvasLinesDisappear
Canvas Lines Disappear
HTML
<canvas id="Grid" width="20000" height="16000">
</canvas>
<canvas id="Grid2" width="200" height="160">
</canvas>
CSS
#Grid {
position: absolute;
left: 0px;
top: 0px;
background-color: #ffff00
}
#Grid2 {
position: absolute;
left: 500px;
top: 0px;
z-index: 2;
background-color: #ffffff
}
JavaScript
draw(document.getElementById("Grid"));
draw(document.getElementById("Grid2"));
function draw(canvas) {
var context = canvas.getContext("2d");
context.beginPath();
context.moveTo(0,0);
context.moveTo(10, 20);
context.lineTo(100, 20);
context.strokeStyle = "#FF0000";
context.lineWidth = 1;
context.stroke();
}