zoukankan      html  css  js  c++  java
  • 返回顶部的button的效果

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <style type="text/css">
    *{
    margin: 0;
    padding: 0;
    }
    ul,li{
    list-style: none;
    }
    ul li{
    height: 30px;
    border-bottom: 1px solid salmon;
    line-height: 30px;
    }
    .return-top{
    20px;
    height: 20px;
    background: black;
    opacity: 0.5;
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    }
    .div1{
    height: 900px;
    100%;
    background: sandybrown;
    }
    </style>
    </head>
    <body>
    <ul>
    <li class="a">1</li>
    </ul>
    <div class="div1">

    </div>
    <div class="return-top">

    </div>
    </body>
    <script src="js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    $(function(){


    $(window).scroll(function(){
    if($(window).scrollTop()>=200){
    $('.return-top').show();
    }else{
    $('.return-top').hide();
    }
    })

    })
    </script>


    </html>

  • 相关阅读:
    libiconv2.dll
    windows下安装,配置gcc编译器
    STM32之DMA
    keilkill.bat
    STM32之系统滴答定时器
    STM32库函数开发使用总结
    STM32之串口通信
    yocto系统介绍
    fork子进程僵尸问题及解决方案
    shell实现的守护进程
  • 原文地址:https://www.cnblogs.com/impossible1994727/p/6654958.html
Copyright © 2011-2022 走看看