Skip to main content

Set height of page to full screen from JavaScript

Call any of the following JS method onload of body like to set the height of page to full screen.

function resizehtml() {
            window.moveTo(0, 0);
            window.resizeTo(screen.availWidth, screen.availHeight);
        }


function setPanelHeight() {
           
            var hederHeight = document.getElementById('header').offsetHeight;
            var footerHeight = document.getElementById('footer').offsetHeight;
            var contentHeight = document.getElementById('content').offsetHeight;
            height = document.body.clientHeight - hederHeight - footerHeight;
            document.getElementById('content').style.height = height;
            }





Comments