mirror of
https://github.com/XIU2/UserScript.git
synced 2026-09-07 11:27:41 +00:00
优化 滚动到隐藏内容处的代码(不使用我的美化脚本也支持了)
This commit is contained in:
+1
-11
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user