Modify index.template.html, add a section of JS to get the width of the browser window, according to the browser window width and height to modify the CSS style, html, body {height:100%; width:100%} Height and width are percentages or specific sizes, scroll bars appear when they are specific sizes and fill the entire window when they are percentages.
Specifically as follows:
1. Add the following JS source code (application size is 1100x600)
Copy Code code as follows:
var winwidth = 0;
var winheight = 0;
function Finddimensions ()
{
Get window width
if (window.innerwidth)
{
Winwidth = window.innerwidth;
}
else if ((document.body) && (document.body.clientWidth)
{
Winwidth = Document.body.clientWidth; Get window Height
}
if (window.innerheight)
{
Winheight = Window.innerheight;
}
else if ((document.body) && (document.body.clientHeight)
{
Winheight = Document.body.clientHeight;
}
Get the window size by detecting the body inside the document
if (document.documentelement && document.documentElement.clientHeight && Document.documentElement.clientWidth)
{
Winheight = Document.documentElement.clientHeight;
Winwidth = Document.documentElement.clientWidth;
}
var csssize = document.stylesheets[0].rules| | Document.stylesheets[0].cssrules;
if (Winwidth < 1100)
{
Csssize[0].style.width = "1100px";
}
Else
{
Csssize[0].style.width = "100%";
}
if (Winheight < 600)
{
Csssize[0].style.height = "600px";
}
Else
{
Csssize[0].style.height = "100%";
}
}
Window.onresize=finddimensions;
function Pageinit () {
Call function, get numeric value
Finddimensions ();
}