社区文档构建进行中,欢迎编辑。社区答疑群(非官方):717421103,点点小课堂(腾讯会议):5696651544
Widget:MyScreen
<script>
window.addEventListener("load",displayScreenInfo)
window.addEventListener("resize",displayScreenInfo)
function displayScreenInfo(){
let infoDom=document.getElementById("myScreen")
infoDom.innerHTML=getScreenInfo()
}
function getScreenInfo(){
let result="我的屏幕:"
result+="
屏幕尺寸【屏幕全宽(screen.width)×屏幕全高(screen.height)】:"+screen.width+"×"+screen.height
result+="
屏幕工作区尺寸【工作区宽(screen.availWidth)×工作区高(screen.availHeight)】:"+screen.availWidth+"×"+screen.availHeight
result+="
*注:工作区指的是排除了诸如任务栏等锁定在屏幕上的区域"
result+="
页面可视区尺寸【页面宽(innerWidth)×页面高(innerHeight)】:"+innerWidth+"×"+innerHeight
return result } </script>