I have this code at the end of a web page:
var canvas = document.getElementByID("canvas");
var ctx = canvas.getContext("2d");
canvas.style.width = $(window).width();
canvas.style.height = $(window).height();
ctx.arc(50, 50, 50, 0, Math.PI * 2, false);
$(window).resize(function () {
canvas.style.width = $(window).width();
canvas.style.height = $(window).height();
console.log("resize");
});
But nothing shows up. I know that the problem is with the arc function because ctx.fillRect(0, 0, 100, 100);
works fine.
Any idea what I am doing wrong?
(Yes, I do have JQuery)