zoukankan      html  css  js  c++  java
  • 文件命名很重要啊

    除了变量命名什么的,文件命名也很重要啊

    <!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <link rel="stylesheet" href="http://static-gwtheme.idkin.com/themes/v1/styles/base.css" />
           <link rel="stylesheet" href="http://static-gwtheme.idkin.com/themes/idu/styles/ad-gallery.css" />
    
           <style>
               .parentElm{
                   position:static;
                   width:200px;
                   height:200px;                
                   border:1px solid red;
                   overflow:hidden;
               }
               .childrenElm{
                   position:relative;
                   width:300px;
                   height:180px; 
                   border:1px solid black;
                   background-color:green;
               }
           </style>
    </head>
    <body>
    <div class="parentElm">
        <div class="childrenElm">        
            <ol>
                <li>position:static 的父元素 overflow 不能遮盖 position 是 absolute 的子元素</li>
                <li>position:fixed 的元素不能被父元素的 overflow 遮盖</li>
                <li>IE6,7: position:static 的父元素 overflow 不能遮盖 position 不是 static 的子元素</li>
            </ol>
        </div>
    </div>
    
    <script>
    var links = document.getElementsByTagName("link");
    var sheets = document.styleSheets;
    var cssCollection = {};
    var styleCount=0;
    var tempUrl,temCss;
    
    for(var i=0;i<links.length;i++){
        tempUrl = links[i].href;
        cssCollection[tempUrl] = {
            fileKey:tempUrl,   
            node:links[i],
            nodeName:links[i].nodeName    
            }
    }
    
    for(var i=0;i<sheets.length;i++){
        tempUrl = sheets[i].href||("style_"+(++styleCount));    
        temCss  = cssCollection[tempUrl]||(cssCollection[tempUrl]= {fileKey:tempUrl});  
        temCss.node = temCss.node||sheets[i].ownerNode||sheets[i].owningElement;
        temCss.nodeName = temCss.nodeName||temCss.node.nodeName;
        temCss.sheet = sheets[i];
    }
    
    console.log(['links.length = '+links.length,
                'style.length = '+styleCount,
                'sheets.length = '+sheets.length
                ]);
    console.log('cssCollection = ',cssCollection);
    
    for(var key in cssCollection){
        if(!cssCollection[key].sheet){
            //why ad-gallery.css fail in firefox 19 ? //我 OOXX ADBLOCK!!!!!!!!
            console.log('============== fail to create styleSheet ================');
            console.log('UA:',window.navigator.userAgent);
            console.log('css : ',cssCollection[key]);
            cssCollection[key].fileKey.match(/^style_\d+$/i) || console.log('fail to load css file: ',cssCollection[key].fileKey);        
        }
    }
    
    </script>
    </body>
    </html>

      

  • 相关阅读:
    1.从Node.js链接到MongoDB
    2.mongoDB add user in v3.0 问题的解决(Property 'addUser' of object admin is not a func)
    汇编——模拟试卷二
    汇编——模拟试卷一
    汇编语言——数据处理的两个基本问题(处理的数据在什么地方 要处理的数据有多长)
    汇编语言——更灵活的定位内存地址的方法
    汇编语言——包含多个段的程序
    汇编语言——[bx]和loop指令
    汇编语言——汇编程序从写出到最终执行的过程
    汇编语言——编译器
  • 原文地址:https://www.cnblogs.com/ecalf/p/2863558.html
Copyright © 2011-2022 走看看