I have created a canvas using the following markup:
Now, if I specify width and
width
Canvas CSS properties do not resize canvas, they rescale it. You may simply change the properties with your JS:
$("#canvas") .prop("width", window.innerWidth) .prop("height", window.innerHeight);