Tag:color use ar work c ef window js different Different browsers may have some differences, please test first when using.var s = "";s + = "page visible area width:" + document.body.clientWidth;s + = "page visible Area High:
Web page Visible area width: Document.body.clientWidth Web page Visible Area High: document.body.clientHeightWeb page Visible Area width: document.body.offsetWidth (including edge and scroll bar width)Web page Visible Area High:
JS get browser window size get screen, browser, page height widthPage 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
Find a good code for using JavaScript to judge browsers and browser versions from the Web, and record this here:
Encapsulate the above code as a method that returns the Sys object, which encapsulates the browser's type and version
$ (document). Ready (function (){Alert ($ (window). Height ()); Browser Current window viewable area heightAlert (document). Height ()); The height of the browser's current window documentAlert ($ (document.body). Height ());//browser Current window
Copy code code as follows:
Get Browser name and version information
function AppInfo () {
var browser = {
Msie:false, Firefox:false, Opera:false, Safari:false,
Chrome:false, Netscape:false, appname: ' Unknown ', version:0
},
Visible area width of the webpage: Document. Body. clientwidth
Visible area height: Document. Body. clientheight
Visible area width of the webpage: Document. Body. offsetwidth (including the width of the edge)
Visible area height of the webpage:
Visible area width of the webpage: Document. Body. clientwidthVisible area height: Document. Body. clientheightVisible area width of the webpage: Document. Body. offsetwidth (including the width of the edge)Visible area height of the webpage:
1, in the web development, will often let you judge the current use of the browser and the browser version, according to the browser version to adjust the style of CSS,So that the Web interface in each browser to achieve the best results, the
Web page Visible area width: document.body.clientWidth;Web page Visible Area High: document.body.clientHeight;(Click to view larger image)Web page Visible Area width: document.body.offsetWidth (including the width of the edge);Web page Visible Area
Web page Visible area width: document.body.clientWidthWeb page Visible Area height: document.body.clientHeightWeb page Visible Area width: document.body.offsetWidth (including edge width)Web page Visible Area High: document.body.offsetHeight
In IE:
Document.body.clientWidth ==> Body Object width
Document.body.clientHeight ==> Body Object Height
Document.documentElement.clientWidth ==> Visible Area width
Document.documentElement.clientHeight ==> Visible Area height
In
In IE:
Document.body.clientWidth ==> Body Object width
Document.body.clientHeight ==> Body Object Height
Document.documentElement.clientWidth ==> Visible Area width
Document.documentElement.clientHeight ==> Visible Area height
In
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.