From 8fc327304de103b005f3ec3169708ec253f64381 Mon Sep 17 00:00:00 2001 From: Eltrac <45323514+BigCoke233@users.noreply.github.com> Date: Sat, 30 Nov 2019 15:23:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=8C=20Add:=20=E9=9D=A0=E8=BF=91?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=A1=B6=E9=83=A8=E6=97=B6=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=BF=94=E5=9B=9E=E9=A1=B6=E9=83=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/miracles.min.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/assets/js/miracles.min.js b/assets/js/miracles.min.js index da8fee25..9e45b306 100644 --- a/assets/js/miracles.min.js +++ b/assets/js/miracles.min.js @@ -41,6 +41,19 @@ function getCookie(cname){ return ""; } +/** + * Base Animation + * 基础动画 + */ +function scaleIn(object,time) { + object.css('transition',time).css('transform','scale(0)'); + object.show(); + object.css('transform','scale(1)'); +} +function scaleOut(object,time) { + object.css('transition',time).css('transform','scale(0)') +} + /** * Dark theme */ @@ -114,6 +127,15 @@ function GoTop() { document.body.scrollTop = 0; document.documentElement.scrollTop = 0; } +$('#gotop').hide(); +$(window).scroll(function(){ + if($(window).scrollTop()>450){ + scaleIn($('#gotop'),'0.7'); + } + else{ + scaleOut($('#gotop'),'0.7'); + } +}); /** * Js Loader