当前位置:网站首页>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();})
边栏推荐
猜你喜欢
随机推荐
【Day5】软硬链接 文件存储,删除,目录管理命令
Getting Started Document 09 Standalone watch
The idea of commonly used shortcut key
时间复杂度和空间复杂度
【Day8】RAID Disk Array
Hugo搭建个人博客
Spark source code - task submission process - 4-container to start executor
[Day8] Commands involved in using LVM to expand
The Servlet to jump to the JSP page, forwarding and redirection
PVE 直通硬盘到TrueNAS
IP address and subnet division
【Day6】文件系统权限管理 文件特殊权限 隐藏属性
错误类型:reflection.ReflectionException: Could not set property ‘xxx‘ of ‘class ‘xxx‘ with value ‘xxx‘
线上问题排查流程
账号与权限管理
入门文档03 区分开发与生产环境(生产环境才执行‘热更新’)
【Day8】 RAID磁盘阵列
正则表达式小实例--验证邮箱地址
The problem of redirecting to the home page when visiting a new page in dsf5.0
洞察互联网大趋势,读完这篇文章你就彻底了解中文域名