• Javascript获取屏幕与页面尺寸


    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page </title>
      <script type="text/javascript">
    function checkValue(){
    debug.innerText="网页可见区域宽:document.body.clientWidth.....:"+document.body.clientWidth+"\n"+
    "网页可见区域高:document.body.clientHeight.....:"+document.body.clientHeight+"\n"+
    "网页可见区域高:document.body.offsetWidth.....:"+document.body.offsetWidth+"\n"+
    "网页可见区域高:document.body.offsetHeight.....:"+document.body.offsetHeight+"\n"+
    "网页正文全文宽:document.body.scrollTop.....:"+document.body.scrollTop+"\n"+
    "网页正文全文高:document.body.scrollLeft.....:"+document.body.scrollLeft+"\n"+
    "网页被卷去的高:window.screenTop.....:"+window.screenTop+"\n"+
    "网页被卷去的左:window.screenLeft.....:"+window.screenLeft+"\n"+
    "屏幕分辨率的高:window.screen.height.....:"+window.screen.height+"\n"+
    "屏幕分辨率的宽:window.screen.width.....:"+window.screen.width+"\n"+
    "屏幕可用工作区高度:window.screen.availHeight.....:"+window.screen.availHeight+"\n"+
    "屏幕可用工作区宽度:window.screen.availWidth.....:"+window.screen.availWidth+"\n"
    }

    </script>
        <script type="text/javascript">
        function IsConfirm()
        {
            return window.confirm('确定删除此记录吗?');
        }
       
        </script>
        </head>
        <body>

                <div>
                <div id="content_a" style="display:none; position:absolute;">
                            这是第一个DIV </div>

                    <input type="button" onclick="checkValue();" value="尺寸调试">改变窗口的大小点击按钮看数值的变化
                        <div id="debug"> </div>
                   
                </div>

        </body>
    </html>

  • 相关阅读:
    2019-9-2-简单搭建自己的博客
    2018-7-15-WPF-在-DrawingContext-的-push-如何使用
    2018-7-15-WPF-在-DrawingContext-的-push-如何使用
    2019-7-3-Roslyn-理解-msbuild-的清理过程
    2019-7-3-Roslyn-理解-msbuild-的清理过程
    MySQL数据库事务详解
    求一个Map中最大的value值,同时列出键,值
    Struts1入门实例(简单登录)
    java字符流操作flush()方法及其注意事项
    HDU 1874 畅通工程续 2008浙大研究生复试热身赛(2)
  • 原文地址:https://www.cnblogs.com/MaxWoods/p/1708666.html
Copyright © 2020-2023  润新知