linked linked linkedin whatsapp remove

HTML 5 Quiz HTML 5

How can an HTML5 canvas size be changed so that it fits the entire window?

#myCanvas {height: 100%; width: 100%;}

<script type="text/javascript"> function resize_canvas(){ canvas = document.getElementById("canvas"); if (canvas.width < window.innerWidth) { canvas.width = window.innerWidth; } if (canvas.height < window.innerHeight) { canvas.height = window.innerHeight; } } </script>

It depends upon the complexity of the canvas, and the frequency of redraws.

Calling the JavaScript getWidth() function.

#myCanvas {height: 100%; width: 100%;}

Note: This Question is unanswered, help us to find answer for this one

Related HTML 5 Questions and Answers:


Evaluate your skill level in just 10 minutes with QUIZACK smart test system.

Copyright © 2021 Quizack . © 2021 All rights reserved