当前位置:网站首页>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
边栏推荐
- [SDU chart team - core] enumeration of SVG attribute class design
- Some thoughts on super in pytorch, combined with code
- Go limit depth traversal of files in directory
- setInterval、setTimeout、requestAnimationFrame
- 阿里云回应用户注册信息泄露事件
- Selenium 显示等待WebDriverWait
- CUDA, NVIDIA driver, cudnn download address and version correspondence
- Is rust more suitable for less experienced programmers?
- Selenium displays webdriverwait
- Opencv application -- jigsaw puzzle
猜你喜欢

电脑越用越慢怎么办?文件误删除恢复方法

go defer

1.整理华子面经--1

Google 尝试在 Chrome 中使用 Rust

Minecraft 1.12.2 module development (43) custom shield

ROS learning notes - tutorial on the use of ROS

Question brushing plan - depth first search DFS (I)

Flomo software recommendation

Mysql database common sense storage engine
![[leetcode sword finger offer 10 - II. Frog jumping steps (simple)]](/img/ab/698810f6fe169adffc3bec5e0dc13f.png)
[leetcode sword finger offer 10 - II. Frog jumping steps (simple)]
随机推荐
Win 11K in 100 days, super complete learning guide for job transfer test
Alibaba cloud responded to the disclosure of user registration information
Plato Farm元宇宙IEO上线四大,链上交易颇高
Chrome 94 引入具有争议的 Idle Detection API,苹果和Mozilla反对
Thinkphp5 + data large screen display effect
Tensorflow realizes gradient accumulation, and then returns
Sharpness difference (SD) calculation method of image reconstruction and generation domain index
UKFslam
[leetcode refers to offer 22. The penultimate node in the linked list (simple)]
Factory mode
Opencv reports an error. Expected PTR < CV:: UMAT > for argument '% s'‘
presto on spark 支持3.1.3记录
3-5通过XSS获取cookie以及XSS后台管理系统的使用
Ubutnu20 installer centernet
CUDA, NVIDIA driver, cudnn download address and version correspondence
Express③(使用Express编写接口、跨域有关问题)
Mysql database common sense storage engine
Express ③ (use express to write interface and cross domain related issues)
Go limit depth traversal of files in directory
Deep understanding of modern mobile GPU (continuously updating)