zoukankan      html  css  js  c++  java
  • 返回顶部

    $(function(){
            //当滚动条的位置处于距顶部100像素以下时,跳转链接出现,否则消失
            $(function () {
                $(window).scroll(function(){
                    if ($(window).scrollTop()>100){
                        $("#back-to-top").fadeIn(1500);
                    }
                    else
                    {
                        $("#back-to-top").fadeOut(1500);
                    }
                });

                //当点击跳转链接后,回到页面顶部位置

                $("#back-to-top").click(function(){
                    $('body,html').animate({scrollTop:0},1000);
                    return false;
                });
            });
        });

  • 相关阅读:
    hdu2844 Coins -----多重背包+二进制优化
    bzoj1452 [JSOI2009]Count ——二维树状数组
    cf685 div2 abcde
    cf675 div2 abcd
    cf669 div2 abcd
    cf668 div2 abcd
    UVA-10795
    cf665 div2 abcd
    Colored Cubes UVALive
    Image Is Everything UVALive
  • 原文地址:https://www.cnblogs.com/qhhw/p/5945956.html
Copyright © 2011-2022 走看看