zoukankan      html  css  js  c++  java
  • 回到顶部 插件

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
      <meta name="keywords" content="" />
      <meta name="description" content="" />
      <title>回到顶部</title>
      <script type="text/javascript" src="js/jquery.js"></script>
      <style>
        html,body {height:3200px}
        html,body,form,input,span,p,img,ul,ol,li,dl,dt,dd {margin:0; padding:0;border:0}
        a { text-decoration:none}
           a:hover {text-decoration:underline}
          #moquu_top{ z-index:2;50px;height:50px;right:30px; position:fixed;cursor:pointer;bottom:60px;background:#f00 url(../images/sbtn.png) 0 -101px;}
          #moquu_top:hover {background:#ff0 url(../images/sbtn.png) -50px -101px}
    </style> </head> <body> <a id="moquu_top" href="javascript:"></a> </body> </html>
    //返回顶部
    function b() {
        h = $(window).height(),
        t = $(document).scrollTop()+h,
        t > h ? $("#moquu_top").show() : $("#moquu_top").hide()
    }
    $(document).ready(function() {
        b(),
        $("#moquu_top").click(function() {
            $(document).scrollTop(0)
        })
    }),
    $(window).scroll(function() {
        b()
    });
  • 相关阅读:
    Promise对象
    iterator和for of 循环
    vue项目基本流程
    BASH_SOURCE 用法
    Java GC CMS 日志分析
    zookeeper 删除snapshot和transaction log的源码解读
    openresty nginx 安装过程记录
    opentesty--luasocket 安装
    为什么要使用SLF4J而不是Log4J
    要过一遍的博客列表
  • 原文地址:https://www.cnblogs.com/qianrong/p/4602485.html
Copyright © 2011-2022 走看看