当前位置:网站首页>JS to get the browser and screen height
JS to get the browser and screen height
2022-04-23 21:23:00 【Sister Chunfeng】
Javascript:
IE in :
document.body.clientWidth ==> BODY Object width
document.body.clientHeight ==> BODY Object height
document.documentElement.clientWidth ==> The width of the visible area
document.documentElement.clientHeight ==> Height of visible area
FireFox in :
document.body.clientWidth ==> BODY Object width
document.body.clientHeight ==> BODY Object height
document.documentElement.clientWidth ==> The width of the visible area
document.documentElement.clientHeight ==> Height of visible area
Opera in :
document.body.clientWidth ==> The width of the visible area
document.body.clientHeight ==> Height of visible area
document.documentElement.clientWidth ==> Page object width ( namely BODY Object width plus Margin wide )
document.documentElement.clientHeight ==> Page object height ( namely BODY Object height plus Margin high )
alert(document.body.clientWidth); // Page visible area width (body)
alert(document.body.clientHeight); // Page visible area high (body)
alert(document.body.offsetWidth); // Page visible area width (body), Include border、margin etc.
alert(document.body.offsetHeight); // Page visible area width (body), Include border、margin etc.
alert(document.body.scrollWidth); // Full text width of web page body , Include the unseen area with scroll bar
alert(document.body.scrollHeight); // Page body full text height , Include the unseen area with scroll bar
alert(document.body.scrollTop); // Web pages are rolled away Top( Scroll bar )
alert(document.body.scrollLeft); // Web pages are rolled away Left( Scroll bar )
alert(window.screenTop); // Browser distance Top
alert(window.screenLeft); // Browser distance Left
alert(window.screen.height); // High screen resolution
alert(window.screen.width); // Width of screen resolution
alert(window.screen.availHeight); // The height of the screen's usable workspace
alert(window.screen.availWidth); // The width of the screen's usable workspace
Jquery
alert($(window).height()); // The height of the viewable area of the browser's current window
alert($(document).height()); // The height of the browser's current window document
alert($(document.body).height()); // Browser current window document body Height
alert($(document.body).outerHeight(true)); // Browser current window document body The total height of Include border padding margin
alert($(window).width()); // The width of the viewable area of the browser's current window
alert($(document).width()); // Browser current window document object width
alert($(document.body).width()); // Browser current window document body Width
alert($(document.body).outerWidth(true)); // Browser current window document body Total width of Include border padding margin
版权声明
本文为[Sister Chunfeng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/110/202204200620164144.html
边栏推荐
- go defer
- Go limit depth traversal of files in directory
- [leetcode refers to offer 22. The penultimate node in the linked list (simple)]
- [※ leetcode refers to offer 32 - II. Print binary tree II from top to bottom (simple)]
- Selenium displays webdriverwait
- Opencv application -- jigsaw puzzle
- Thinkphp5 + data large screen display effect
- Ubutnu20 installer centernet
- 一文解决浏览器跨域问题
- Detectron2 usage model
猜你喜欢

go defer

Thinkphp5 + data large screen display effect

Question brushing plan - depth first search (II)
![[leetcode refers to offer 32 - III. print binary tree III from top to bottom (medium)]](/img/36/6a7bb26716f5e0e7733fc383b29951.png)
[leetcode refers to offer 32 - III. print binary tree III from top to bottom (medium)]

亚马逊和Epic将入驻,微软应用商城向第三方开放

Lunch on the 23rd day at home

airbase 初步分析

Opencv application -- jigsaw puzzle

Deep analysis of C language function

41. The first missing positive number
随机推荐
Pytorch: runtimeerror: an attempt has been made to start a new process Error reporting (resolved)
Chrome 94 introduces the controversial idle detection API, which apple and Mozilla oppose
The computer is out of power. How did I pass the terrible interview of Tencent cloud?
Common commands of MySQL in Linux
Prim、Kruskal
Some thoughts on super in pytorch, combined with code
Google 尝试在 Chrome 中使用 Rust
软件测试要怎么学?自学还是培训看完这篇文章你就懂了
[※ leetcode refers to offer 46. Translate numbers into strings (medium)]
Thinkphp5 + data large screen display effect
【SDU Chart Team - Core】SVG属性类设计之枚举
DeNO 1.13.2 release
Selenium displays webdriverwait
1.整理华子面经--1
使用mbean 自动执行heap dump
MySQL advanced common functions
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:app:stripDe
Opencv application -- jigsaw puzzle
Explore ASP Net core read request The correct way of body
Unit function expansion