• 网页超过一屏时自动浮动在网页最上方的图层特效


    <!doctype html>
    <html lang="en">
    <head>
     <meta charset="UTF-8">
     <title>adsorption</title>
     <style type="text/css">
      *{ margin: 0; padding: 0; }
      .header-wrap{ width: 100%; }
      .header-hd{ width: 980px; height: 150px; margin: 0 auto; background-color: #ccc; }
      .header-bd{ width: 980px; height: 40px; margin: 0 auto; background-color: green; }
      .fixed{ position: fixed; width: 100%; }
      .fixed .header-hd{ display: none; }
     </style>
    
     <script type="text/javascript">
      window.onload=function(){
       function adsorption(){
        var headerWrap=document.getElementById('header-wrap');
        var scrollTop=0;
        window.onscroll=function(){
         scrollTop=document.body.scrollTop||document.documentElement.scrollTop;
         if(scrollTop>100){
          headerWrap.className='fixed';
         }else{
          headerWrap.className='header-wrap';
         }
        }
       }
       adsorption();
      }
     </script>
    </head>
    <body style="height:3000px;">
     <div id="header-wrap" class="header-wrap">
      <div class="header-hd"></div>
      <div class="header-bd"></div>
     </div>
    </body>
    </html>
  • 相关阅读:
    jvm-类加载
    jvm调优
    jdk8与jdk9的共存
    eclipse的插件开发-启动时间
    斐波那契数列算法逐层优化(C++)
    2G.处女座与复读机(C++)
    3I.处女座的约会(C++)
    3D.处女座的训练(C++)
    3E.处女座和小姐姐(C++)
    3C.处女座点名(C++)
  • 原文地址:https://www.cnblogs.com/zhangs1986/p/3642746.html
Copyright © 2020-2023  润新知