There are two of the following about JS to get the window size instance code, get the window size method is to use the JS Document.body.clentwidth method to example. There are many methods, which are described in detail below.
<script>
Function GetInfo ()
{
var s = "";
s + + page visible area wide: + document.body.clientwidth;
S + + "Web page visible Area High:" + document.body.clientheight;
S + + page visible area wide: "+ Document.body.offsetwidth +" (including Edge and scroll bar width); The
s + + page visible area is High: "+ Document.body.offsetheight +" (including edge width);
S + + "Web page full text width:" + document.body.scrollwidth;
S + = "The full text of the page is high:" + document.body.scrollheight;
S + + pages are rolled high (FF): "+ document.body.scrolltop;"
S + + pages are rolled high (ie): "+ document.documentelement.scrolltop; The
S + + page is rolled away to the left: "+ document.body.scrollleft;
S + + page body part: "+ window.screentop;
S + + page body part left: "+ window.screenleft;
S + = "high screen resolution:" + window.screen.height;
S + + screen resolution width: + window.screen.width;
&NBSP;&NBsp; s + + screen available Workspace height: + window.screen.availheight;
S + + screen available workspace width: + window.screen.availwidth;
s + + "your screen setting is" + window.screen.colordepth + "bit color";
s + + "your screen settings" + window.screen.devicexdpi + "pixel/inch";
//alert (s);
}
GetInfo ();
</script>
Commonly used
Web page visible area wide:document.body.clientwidth
Page visible Area high:document.body.clientheight
Web page visible area wide: document.body.offsetwidth (including edge width)
Page visible Area high:document.body.offsetheight (including edge width)
Web page full text width:document.body.scrollwidth
Full text of the Web page high:document.body.scrollheight
Web pages are rolled High: document.body.scrolltop
pages are rolled left:document.body.scrollleft
Page body section:window.screentop
page body part left:window.screenleft
High:window.screen.height for screen resolution
Screen resolution wide:window.screen.width
screen available workspace height: window.screen.availheight
Screen available workspace width: window.screen.availwidth