diff --git a/index.html b/index.html index f285a2e..d4d754e 100644 --- a/index.html +++ b/index.html @@ -147,7 +147,7 @@
@@ -322,19 +322,19 @@ })(); // 底部滚动 - (function () { + (function(){ let timer = null; - let $gotop = document.querySelector('.mod-fixedbar a'); - $gotop.addEventListener('click', function () { + let $gotop = document.querySelector('.mod-fixedbar .gotop'); + $gotop.addEventListener('click',function(){ cancelAnimationFrame(timer); - let scrollTop = document.body.scrollTop || document.documentElement.scrollTop; - let move = scrollTop / 18; - timer = requestAnimationFrame(function fn() { - var oTop = document.body.scrollTop || document.documentElement.scrollTop; - if (oTop > 0) { - document.body.scrollTop = document.documentElement.scrollTop = oTop - move; + let scrollTop = document.documentElement.scrollTop; + let move = scrollTop/18; + timer = requestAnimationFrame(function fn(){ + var oTop = document.documentElement.scrollTop; + if(oTop > 0){ + document.documentElement.scrollTop = oTop - move; timer = requestAnimationFrame(fn); - } else { + }else{ cancelAnimationFrame(timer); } }); diff --git a/static/style/index.css b/static/style/index.css index 944fde2..2e4edf6 100644 --- a/static/style/index.css +++ b/static/style/index.css @@ -500,7 +500,6 @@ a:hover{ line-height: 30px; } - .mod-fixedbar .bd { position: fixed; right: 20px; @@ -514,25 +513,13 @@ a:hover{ height: 48px; margin-bottom: 2px; background: rgba(255,255,255,0.8); - border: 1px solid #f0f0f0; + box-shadow: 1px 1px 6px rgba(0,0,0,0.1); line-height: 48px; text-align: center; } -.mod-fixedbar .bd .popup{ - display: none; - position: absolute; - right: 50px; - bottom: 0; - z-index: 99; - border: 1px solid #f0f0f0; - box-shadow: 0 0 2px 0 rgba(0,0,0,0.05); -} .mod-fixedbar .bd a:hover{ background: rgba(255,255,255,0.9); } -.mod-fixedbar .bd a:hover .popup{ - display: block; -} @media screen and (max-width: 1020px) { .header{