Home >Web Front-end >JS Tutorial >JS obtains web page attributes including width, height, etc._javascript skills

JS obtains web page attributes including width, height, etc._javascript skills

WBOY
WBOYOriginal
2016-05-16 16:53:38946browse
Copy code The code is as follows:

function getInfo()
{
var s = " ";
s = " The width of the visible area of ​​the web page: " document.body.clientWidth " ";
s = " The height of the visible area of ​​the web page: " document.body.clientHeight " ";
s = " The visible area of ​​the web page Area width: " document.body.offsetWidth " (including the width of the edges and scroll bars)" " ";
s = " Web page visible area height: " document.body.offsetHeight " (including the width of the edges)" " " ;
s = " Full text width of web page body: " document.body.scrollWidth " ";
s = " Full text height of web page body: " document.body.scrollHeight " ";
s = " Web page is scrolled The height to which the web page was scrolled (ff): " document.body.scrollTop " ";
s = " The height to which the web page was scrolled (ie): " document.documentElement.scrollTop " ";
s = " The web page was scrolled Go to the left: " document.body.scrollLeft " ";
s = " The body of the web page: " window.screenTop " ";
s = " The body of the web page to the left: " window.screenLeft " ";
s = "The height of the screen resolution: " window.screen.height " ";
s = " The width of the screen resolution: " window.screen.width " ";
s = " Screen available work Area height: " window.screen.availHeight " ";
s = " Screen available work area width: " window.screen.availWidth " ";
s = " Your screen setting is " window.screen.colorDepth " bit color " " ";
s = " your screen settings" window.screen.deviceXDPI " pixels/inch" " ";
s = " actual height of the visible part of the window (ff) " window .innerHeight " ";
alert (s);
};
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn