From e70a3aa7486fd4b759918893476dff1c4e6147ef Mon Sep 17 00:00:00 2001 From: Eltrac <45323514+BigCoke233@users.noreply.github.com> Date: Mon, 5 Aug 2019 12:54:44 +0800 Subject: =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96/=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96/Bug=20Fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/miracles.min.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'assets/js') diff --git a/assets/js/miracles.min.js b/assets/js/miracles.min.js index a4e32d9..57d2d60 100644 --- a/assets/js/miracles.min.js +++ b/assets/js/miracles.min.js @@ -161,12 +161,10 @@ function bodyScroll(event){ event.preventDefault(); } function banScroll() { - document.body.addEventListener('touchmove',bodyScroll,false); - $('body').css({'position':'fixed',"width":"100%"}); + $('html').css({'overflow':'hidden'}); } function allowScroll() { - document.body.removeEventListener('touchmove',bodyScroll,false); - $("body").css({"position":"initial","height":"auto"}); + $('html').css({'overflow':'auto'}); } /** @@ -288,9 +286,12 @@ function toggleDrawer() { /** * Alert */ -function alertSend(content) { +function alertSend(content,auto) { $(".alert-content").text(content); $(".alert").removeClass("ready"); + if (auto===true) { + window.setTimeout(function(){$(".alert").addClass("ready");},3500); + } } function alertClose() { $(".alert").addClass("ready"); @@ -302,7 +303,7 @@ function alertClose() { $(document).ready(function() { $("body").bind({ copy : function(){ - alertSend("复制成功!若使用请注明原作者及原地址!"); + alertSend("复制成功!若使用请注明原作者及原地址!",true); } }); }); @@ -338,7 +339,7 @@ L2Dwidget.init(config); * Load Pjax */ if(loadPjax = true) { - $(document).pjax('a[href^="'+siteurl+'"]:not(a[target="_blank"], a[no-pjax], .comment-reply a, .cancel-comment-reply a)', { + $(document).pjax('a[href^="' + siteurl + '"]:not(a[target="_blank"], a[no-pjax], .comment-reply a, .cancel-comment-reply a)', { container: '#pjax-container',fragment: '#pjax-container',timeout: 8000 }).on('pjax:send', function () { GoTop(); -- cgit v1.2.3