From 5b4ca30e3881fe1c6d3925bf65cbb0f7d5df16f3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 21 Feb 2021 11:07:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E5=88=B0=E9=9A=90=E8=97=8F=E5=86=85=E5=AE=B9=E5=A4=84=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=88=E4=B8=8D=E4=BD=BF=E7=94=A8=E6=88=91?= =?UTF-8?q?=E7=9A=84=E7=BE=8E=E5=8C=96=E8=84=9A=E6=9C=AC=E4=B9=9F=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhiyoo-Enhanced.user.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 5f99b5f..8c5f6cc 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -208,12 +208,7 @@ // 存在隐藏内容,自动回复 if (document.getElementsByClassName("showhide").length == 0){ writeReply(); - // 如果使用了我的智友帮美化脚本,则定位至底部,反之定位至顶部 - if (document.getElementById("fastpostmessage").offsetParent == null){ - setTimeout(`window.scrollTo(0,99999999)`, 1000); - }else{ - setTimeout(`window.scrollTo(0,0)`, 1000); - } + setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 1000); } } } @@ -240,12 +235,7 @@ // 如果已显示隐藏内容,则定位到隐藏内容区域 // 如果没有发现已显示隐藏内容,就不定位了 if (document.getElementsByClassName("showhide").length > 0){ - // 如果使用了我的智友帮美化脚本,则定位至底部 - /*if (document.getElementById("fastpostmessage").offsetParent == null){ - //setTimeout(`window.scrollTo(0,99999999)`, 1000); - }*/ setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); - //setTimeout(`location.hash='#footer'`, 1000); } } }