zoukankan      html  css  js  c++  java
  • 获取页面宽高数据 PHP

    代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title>无标题页</title>
    <style type="text/css">
    b
    {color:blue;}
    </style>
    </head>
    <body>
    <div id="div1" style="2000px; height:3000px; font-family:Consolas;" ondblclick="showSize();">
    </div>
    <script type="text/javascript">
    function show(str)
    {
    eval(
    'var value=' + str + ';');
    var strHTML = '<span>' + str + ': </span>';
    strHTML
    += '<b>'+value+'</b>';
    strHTML
    += '<br>';
    document.getElementById(
    'div1').innerHTML += strHTML;
    }
    function showSize()
    {
    show(
    'document.body.clientWidth');
    show(
    'document.body.clientHeight');
    show(
    'document.body.offsetWidth');
    show(
    'document.body.offsetHeight');
    show(
    'document.body.scrollWidth');
    show(
    'document.body.scrollHeight');
    show(
    'document.body.scrollTop');
    show(
    'document.body.scrollLeft');
    show(
    'window.screenTop');
    show(
    'window.screenLeft');
    show(
    'window.screen.width');
    show(
    'window.screen.height');
    show(
    'window.screen.availWidth');
    show(
    'window.screen.availHeight');
    show(
    'document.documentElement.offsetWidth');
    show(
    'document.documentElement.offsetHeight');
    show(
    'document.documentElement.clientWidth');
    show(
    'document.documentElement.clientHeight');
    show(
    'document.documentElement.scrollWidth');
    show(
    'document.documentElement.scrollHeight');
    document.getElementById(
    'div1').innerHTML += '<hr>';
    }
    showSize();
    </script>
    </body>
    </html>




    欢迎转载,转载请注明:转载自[ http://www.cnblogs.com/zjfree/ ]
  • 相关阅读:
    批量插入SQL(适用于数据量十万级以上的快速大量插入)
    python爬虫BUG(爬取航班信息)
    python爬虫实例(爬取航班信息)
    python入门基础
    C#生成Guid的几种方式
    微信小程序echart图
    替换SQL字段中的换行符,回车符
    ASP.NET目录
    增删改查程序
    C++中explicit关键字的使用
  • 原文地址:https://www.cnblogs.com/zjfree/p/2219244.html
Copyright © 2011-2022 走看看