+ 4

How I can get responsive fullscreen canvas

Need full exemple code for responsive fullscreen canvas. Thank you in advance.

4th Sep 2018, 9:39 AM
HAYK BEGUNTS
HAYK BEGUNTS - avatar
2 Answers
+ 40
add these 2 lines in your code canvas.width = window.innerWidth; canvas.height = window.innerHeight; The innerWidth property returns the width of a window's content area. The innerHeight property returns the height of a window's content area. https://stackoverflow.com/questions/50883509/making-canvas-fullscreen-using-javascript https://code.sololearn.com/WfA54299UQ0G/?ref=app
4th Sep 2018, 11:14 AM
Elizabeth🌸
Elizabeth🌸 - avatar
+ 2
Elizabeth Thanks👍
4th Sep 2018, 11:22 AM
HAYK BEGUNTS
HAYK BEGUNTS - avatar