Do mobile Web development to do browser compatibility, so found on the Internet some summary under.
Alert ($ (document.body). Height ());
Alert ($ (document.body). Outerheight (True));
Alert (document). width ());
Alert ($ (document.body). width ());
Alert ($ (document.body). Outerwidth (True));
Gets the height and width of the page
function GetPageSize () {
var xscroll, Yscroll;
if (window.innerheight && window.scrollmaxy) {
Xscroll = window.innerwidth + Window.scrollmaxx;
Yscroll = Window.innerheight + window.scrollmaxy;
else {
All but Explorer Mac
Xscroll = Document.body.scrollWidth;
Yscroll = Document.body.scrollHeight;
Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
Xscroll = Document.body.offsetWidth;
Yscroll = Document.body.offsetHeight;
}
}
var windowwidth, WindowHeight;
All except Explorer
if (document.documentElement.clientWidth) {
WindowWidth = Document.documentElement.clientWidth;
else {
WindowWidth = Self.innerwidth;
}
WindowHeight = Self.innerheight;
else {
Explorer 6 Strict Mode
WindowWidth = Document.documentElement.clientWidth;
WindowHeight = Document.documentElement.clientHeight;
else {
Other explorers
WindowWidth = Document.body.clientWidth;
WindowHeight = Document.body.clientHeight;
}
}
}
For small pages and total height less then height of the viewport
if (Yscroll < WindowHeight) {
PageHeight = WindowHeight;
else {
PageHeight = Yscroll;
}
For small pages and total width less then width of the viewport
if (Xscroll < windowwidth) {
PageWidth = Xscroll;
else {
PageWidth = WindowWidth;
}
New Array (PageWidth, PageHeight, WindowWidth, windowheight);
return arraypagesize;
}
scroll bar
Document.body.scrollTop;
$ (document). ScrollTop ();
Copyright, welcome reprint, reproduced Please indicate the source, thank you
Reprint: JQuery Get screen height, width