• 转: 根据屏幕分辨率,浏览器调用不同css


    <link type="text/csss" href="" rel="stylesheet"/>

    <link type="text/csss" href="" rel="stylesheet"/>

    <link type="text/csss" href="" rel="stylesheet"/>

    <script type="text/javascript">

    if (window.navigator.userAgent.indexOf("MSIE")>=1) 
      { 
        var ie600="ie1.css"; 
        var ie768="ie2.css"; 
        var ie864="ie3.css";
        var ie960="ie4.css"; 
        var ieOtherother="ie6.css";
        ScreenWidth(ie600,ie768,ie864,ie960,ieOtherother);
      }else{ 
       //if (window.navigator.userAgent.indexOf("Firefox")>=1) { 
        //如果浏览器为Firefox 
       // var Firefox1024="style1"; 
       // var Firefox800="style2.css"; 
       // var Firefox1152="css1.css"; 
       // var Firefoxother="css1.css"; 
       // ScreenWidth(Firefox1024,Firefox800,Firefox1152,Firefoxother); 
       //}else{ 
        //如果浏览器为其他 
        var Other600="qita1.css"; 
        var Other768="qita2.css"; 
        var Other864="qita3.css";
        var Other960="qita4.css";
        var Otherother="qita.css";
        ScreenWidth(Other600,Other768,Other864,Other960,Otherother); 
       //} 
      } 
      function ScreenWidth(CSS1,CSS2,CSS3,CSS4,CSS5){ 
       if (screen.height <= 600){ 
        setActiveStyleSheet(CSS1); 
       }else{
        if((screen.height>=600) && (screen.height<=768)){
         setActiveStyleSheet(CSS2);
        }else{
         if ((screen.width >=768) && (screen.height <=864 )){ 
          setActiveStyleSheet(CSS3); 
         }else{ 
          if ((screen.height >= 864) && (screen.height <=960 )){ 
           setActiveStyleSheet(CSS4); 
          }else{ 
           setActiveStyleSheet(CSS5);
          }
         }
        } 
        
       } 
      } 
      function setActiveStyleSheet(title){document.getElementsByTagName("link")[2].href="<%=path %>consultantHelp/css/"+title;}  
      <!--
       //根据浏览器来选择CSS
      // if (!window.XMLHttpRequest) {
      //  setActiveStyleSheet("ie6.css"); //IE6
      // }else if(window.ActiveXObject){
      //  setActiveStyleSheet("ie6.css"); //IE7
      // } else {
      //  setActiveStyleSheet("qita.css"); //Mozilla FireFox、Safari, etc.
      // }
      // function setActiveStyleSheet(filename){
      //  document.getElementsByTagName("link")[2].href="<%=path %>consultantHelp/css/"+filename; 
      // }
       -->
     </script>

  • 相关阅读:
    Linux常用操作命令
    Linux下查看CPU型号,内存大小,硬盘空间命令
    PhpExcel中文帮助手册|PhpExcel使用方法
    PHP操作cookie函数:setcookie()与setrawcookie()
    利用phantomjs模拟QQ自动登录
    无法在同一张表上查询和更新的问题解决方法
    App开放接口api安全性—Token签名sign的设计与实现
    开放api接口签名验证
    bootstrap字体图标
    booatrap中的表格样式
  • 原文地址:https://www.cnblogs.com/jearay/p/3392079.html
Copyright © 2020-2023  润新知