javascript - Canvas toggle filling whole page removing scrollbar -
I have found a canvas on my page and want to toggle the page and backwards. My page is usually " High ", the height of the screen is, so there is a scrollbar on my page when I am setting the size of my canvas in my CSS, it does not hide scrollbars:
canvas {display: inline; Profile: 0; Margin: 50; Border: 1px solid #E0E0E0; } Canvas.fullscreen {Display: Block; Status: Completed; Top: 0; Left: 0; Border: None; Margin: 0; }
My JavaScript looks like this:
// Toggle fullscreen fullscreen (if (! FullWindowState) {fullWindowState = true; // Canvas full window canvas.width goes to the window.internalWidth; canvas.heat = window.white; canvas.className = "fullscreen"} and {fullWindowState = false; // canvas canvas becomes normal.Wide = 820; Canvas Height = 600; Canvas.className = "";}}
The entire code is also on the GTU and the page is on gh-pages
I do not know the scrollbarWhat to do to remove when everybody is in the canvas "fullscreen" mode is apreciated!
Thanks! Patsimm
fullWindowState
<=> text
overflow
>// Toggle fullscreen fullscreen mode (if (FullWindowState) {fullWindowState = true; // canvas full window canvas.width = window goes to innerWidth; Canvas.heat = window.white; Canvas.className = "fullscreen" document.body.scrollTop = 0; // & lt; - Drag the page back to the document above. Dog.style.overflow = 'hidden'; // & lt; - relevant additional} and {fullWindowState = false; // canvas canvas becomes normal. Wide = 820; Canvas.height = 600; Canvas.className = ""; Document.body.style.overflow = 'visible'; // & lt; - toggle back to normal mode}}
Comments
Post a Comment