screen对象及属性(availWidth、availHeight)

复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>screen对象及属性(availWidth、availHeight)</title>
    <!-- 
        屏幕可用
        screen.availWidth;获取屏幕宽度
        screen.availHeight;获取屏幕高度
        浏览器窗口
        window.innerWidth;获取浏览器窗口宽度
        window.innerHeight;获取浏览器窗口高度
     -->
</head>
<body>
    <script>
        console.log(screen.availWidth);//电脑屏幕宽
        console.log(screen.availHeight);//电脑屏幕高
        console.log(innerWidth);//浏览器窗口宽
        console.log(innerHeight);//浏览器窗口高
    </script>
</body>
</html>
复制代码

posted on   loongw  阅读(433)  评论(0编辑  收藏  举报

努力加载评论中...

导航

点击右上角即可分享
微信分享提示