From 820183dbedcd2c48ff31114bd8da6d743bef5d2d Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Thu, 28 Oct 2021 10:12:24 +0800 Subject: [PATCH] =?UTF-8?q?Check=20more=20=E5=A2=9E=E5=8A=A0=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/views/mobile_first/gh-pc.php | 46 ++++++++++++------------ application/views/mobile_first/gh.php | 46 ++++++++++++------------ 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/application/views/mobile_first/gh-pc.php b/application/views/mobile_first/gh-pc.php index 8fe9a46f..af4622b1 100644 --- a/application/views/mobile_first/gh-pc.php +++ b/application/views/mobile_first/gh-pc.php @@ -312,28 +312,30 @@ height="0" width="0" style="display:none;visibility:hidden"> function loadScriptByAsync(src) {var asyncScript = document.createElement("script");asyncScript.async = true;asyncScript.crossorigin = "anonymous";asyncScript.src = src;firstScript=document.getElementsByTagName("script")[0];firstScript.parentNode.insertBefore(asyncScript, firstScript);} +((doc, buttonId, contentId) => { + doc.addEventListener('DOMContentLoaded', () => { + var moreButton = doc.getElementById(buttonId); + var contentDiv = doc.getElementById(contentId); + var lastContentDiv = doc.getElementById(lastContentId); + if (moreButton === null || contentDiv === null || lastContentDiv === null) { + console.warn('CHECK MORE config error'); + return; + } + moreButton.addEventListener('click', () => { + moreButton.classList.add('gh-animate-fade-out'); + setTimeout(() => { + moreButton.classList.add('gh-display-none'); + }, 80); + contentDiv.classList.remove('gh-display-none'); + lastContentDiv.classList.remove('normal_content'); + setTimeout(() => { + contentDiv.classList.remove('gh-animate-slide-down'); + contentDiv.classList.add('gh-animate-slide-up'); + }, 0); + }); + }); +})(document, 'checkMoreButton', 'moreContentDiv', 'lastContentDiv'); + +((doc, buttonId, contentId) => { + doc.addEventListener('DOMContentLoaded', () => { + var moreButton = doc.getElementById(buttonId); + var contentDiv = doc.getElementById(contentId); + var lastContentDiv = doc.getElementById(lastContentId); + if (moreButton === null || contentDiv === null || lastContentDiv === null) { + console.warn('CHECK MORE config error'); + return; + } + moreButton.addEventListener('click', () => { + moreButton.classList.add('gh-animate-fade-out'); + setTimeout(() => { + moreButton.classList.add('gh-display-none'); + }, 80); + contentDiv.classList.remove('gh-display-none'); + lastContentDiv.classList.remove('normal_content'); + setTimeout(() => { + contentDiv.classList.remove('gh-animate-slide-down'); + contentDiv.classList.add('gh-animate-slide-up'); + }, 0); + }); + }); +})(document, 'checkMoreButton', 'moreContentDiv', 'lastContentDiv'); +