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);
                }
  • 相关阅读:
    【spring 事务注解配置】事务回滚
    myisam 和 innodb 对比
    mysql replace into用法详细说明
    [nginx] 配置
    【lucene】中文分词
    Lucene 4.9 document的简单应用
    Spring事务配置的五种方式
    Open-Drain与Push-Pull
    HDMI中的AVmute是什么功能
    在Keil uv5里面添加STC元器件库,不影响其他元件
  • 原文地址:https://www.cnblogs.com/zwei1121/p/759308.html
Copyright © 2011-2022 走看看