Web ページの最後に次のコードがあります。
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");
});
しかし、何も表示されません。正常に動作するため、アーク関数に問題があることはわかっていctx.fillRect(0, 0, 100, 100);
ます。
私が間違っていることは何ですか?
(はい、私は JQuery を持っています)