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/ ]
  • 相关阅读:
    JSTL标签用法
    (转)javascript正则实战
    Spring中几种数据源的配置
    (转)常用正则表达式
    EL表达式详解
    JAVA环境变量配置(转)
    S2SH整合步骤
    正则表达式30分钟教程(转)
    在Flash Player 10.2中使用原生鼠标指针
    time
  • 原文地址:https://www.cnblogs.com/zjfree/p/2219244.html
Copyright © 2011-2022 走看看