当前位置:网站首页>js dynamically get screen width and height
js dynamically get screen width and height
2022-08-05 06:13:00 【CrazyQiQi】
Javascript:
The width of the visible area of the web page: document.body.clientWidth
The visible area of the web page is high: document.body.clientHeight
The width of the visible area of the web page: document.body.offsetWidth (including the width of the border)
The height of the visible area of the web page: document.body.offsetHeight (including the height of the edge)
Web page body full text width: document.body.scrollWidth
Height of the full text of the page body: document.body.scrollHeight
The web page is scrolled high: document.body.scrollTop
The page is scrolled to the left: document.body.scrollLeft
On the body of the page: window.screenTop
The left part of the body of the webpage: window.screenLeft
High screen resolution: window.screen.height
Width of screen resolution: window.screen.width
Screen available workspace height: window.screen.availHeight
Screen available workspace width: window.screen.availWidth
jQuery gets screen width and height in real time
// native jswindow.οnlοad=function(){changeDivHeight();}//When the browser window size changes, set the height of the displayed contentwindow.οnresize=function(){changeDivHeight();}function changeDivHeight(){var h = document.documentElement.clientHeight;//Get page visible height}// jquery$(window).resize(function(){var Height = $(window).height();var Width = $(window).width();})
边栏推荐
- 云计算——osi七层与TCP\IP协议
- Spark source code-task submission process-6.2-sparkContext initialization-TaskScheduler task scheduler
- spark算子-wholeTextFiles算子
- Why can't I add a new hard disk to scan?How to solve?
- 入门文档12 webserve + 热更新
- spark source code - task submission process - 2-YarnClusterApplication
- The problem of calling ds18b20 through a single bus
- [Paper Intensive Reading] The relationship between Precision-Recall and ROC curves
- LinkSLA坚持用户第一,打造可持续的运维服务方案
- 【Day1】(超详细步骤)构建软RAID磁盘阵列
猜你喜欢
随机推荐
spark源码-任务提交流程之-1-sparkSubmit
Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
[Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data
快问快答—腾讯云服务器常见问题解答
IP地址及子网的划分
正则表达式小示例--获取重复最多的字符及其数量
Getting Started 04 When a task depends on another task, it needs to be executed in sequence
Technology Sharing Miscellaneous Technologies
什么?CDN缓存加速只适用于加速静态内容?
LinkSLA坚持用户第一,打造可持续的运维服务方案
腾讯云云函数SCF—入门须知
Spark source code-task submission process-6.2-sparkContext initialization-TaskScheduler task scheduler
传输层协议(TCP3次握手)
spark源码-任务提交流程之-7-流程梳理总结
The spark operator - coalesce operator
Remembering my first CCF-A conference paper | After six rejections, my paper is finally accepted, yay!
入门文档04 一个任务依赖另外一个任务时,需要按顺序执行
入门文档01 series按顺序执行
正则表达式小实例--去掉字符串中间和两边的空格
[Paper Intensive Reading] The relationship between Precision-Recall and ROC curves