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