zoukankan      html  css  js  c++  java
  • 在ASP.NET AJAX中如何判断浏览器及计算其宽高

    在ASP.NET AJAX中如何判断浏览器及计算其宽高
                function getClientBounds()
                
    {
                    
    var clientWidth;
                    
    var clientHeight;
                    
    switch(Sys.Browser.agent) {
                        
    case Sys.Browser.InternetExplorer:
                            clientWidth 
    = document.documentElement.clientWidth;
                            clientHeight 
    = document.documentElement.clientHeight;
                            
    break;
                        
    case Sys.Browser.Safari:
                            clientWidth 
    = window.innerWidth;
                            clientHeight 
    = window.innerHeight;
                            
    break;
                        
    case Sys.Browser.Opera:
                            clientWidth 
    = Math.min(window.innerWidth, document.body.clientWidth);
                            clientHeight 
    = Math.min(window.innerHeight, document.body.clientHeight);
                            
    break;
                        
    default:  // Sys.Browser.Firefox, etc.
                            clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
                            clientHeight 
    = Math.min(window.innerHeight, document.documentElement.clientHeight);
                            
    break;
                    }


                    
    return new Sys.UI.Bounds(00, clientWidth, clientHeight);
                }
  • 相关阅读:
    toolblock 编写脚本并运用。
    C#等待子线程执行完毕
    win10+python3.7+dlib+opencv+face_recognition实现人脸识别
    c# tcp/ip通信
    【微信Xposed】kotlin反射异常RuntimeException:looper or serial is null
    安卓APK开启调试
    常用汇编指令对标志位的影响
    简单的.net反调试,调试检测
    虚拟机VMware和win10 hyper-v不兼容的问题
    对某城APP抓包分析--过SSL证书校验
  • 原文地址:https://www.cnblogs.com/zwei1121/p/759308.html
Copyright © 2011-2022 走看看