原生js获取屏幕的宽高
2024-09-24 15:48:07
function client(){
if(window.innerHeight !== undefined){
return {
"width": window.innerWidth,
"height": window.innerHeight
}
}else if(document.compatMode === "CSS1Compat"){
return {
"width": document.documentElement.clientWidth,
"height": document.documentElement.clientHeight
}
}else{
return {
"width": document.body.clientWidth,
"height": document.body.clientHeight
}
}
}
最新文章
- php判断字符串A是否含有字符串B
- ctrl+enter提交留言
- mysql_insert_id 为什么会返回空值
- 配置PhpStorm调试PHP
- 静态化 - 伪静态技术(Apache Rewrite 实现)
- springMVC框架中json处理
- PureLayout
- NOIP2016提高组初赛(C++语言)试题 个人的胡乱分析
- ectouch 概述
- How to learn PDE (怎么学偏微分方程)
- 使用jvisualVm监控本地和远程的jvm
- xadmin2.0(for Django2.0) 基本设置
- LIS|计蒜客2019蓝桥杯省赛 B 组模拟赛(一)
- 递归获取包下的class文件
- appium入门级教程(2)—— 安装Appium-Server
- 找到当前mysql group replication 环境的primary结点
- 基于sersync海量文件实时同步
- js 匿名函数-立即调用的函数表达式
- ABC103
- Hibernate表关系映射之一对多映射