元素的 id
+ const scrollHeight = ulElement.scrollTop;
+ const ulHeight = ulElement.offsetHeight;
+ if (liHight > scrollHeight + ulHeight) {
+ ulElement.scrollTop += (pHihtt + 24);
+ }
+ if (liHight < scrollHeight) {
+ ulElement.scrollTop -= (pHihtt + 24);
+ }
return;
}
}
diff --git a/public/site/en/log.html b/public/site/en/log.html
index 6f0e8bf7e..cdf1df3bd 100644
--- a/public/site/en/log.html
+++ b/public/site/en/log.html
@@ -511,6 +511,18 @@ function scrollHandler(){
rm()
let elementsWithDataId = document.querySelectorAll("[data-id='" + `section-${i}` + "']");
elementsWithDataId[1]?.classList?.add("active");
+ //滚动设置
+ const liHight = elementsWithDataId[1]?.offsetTop;
+ const pHihtt = elementsWithDataId[1]?.offsetHeight;
+ const ulElement = document.getElementById('help-l-ul'); // 替换为你的
元素的 id
+ const scrollHeight = ulElement.scrollTop;
+ const ulHeight = ulElement.offsetHeight;
+ if (liHight > scrollHeight + ulHeight) {
+ ulElement.scrollTop += (pHihtt + pHihtt);
+ }
+ if (liHight < scrollHeight) {
+ ulElement.scrollTop -= (pHihtt + pHihtt);
+ }
return;
}
}
diff --git a/public/site/zh/help.html b/public/site/zh/help.html
index 10d7b2e1c..dfa268eb4 100644
--- a/public/site/zh/help.html
+++ b/public/site/zh/help.html
@@ -816,6 +816,18 @@ function scrollHandler(){
if (arrOffsetTop[i] > window.scrollY){
let elementsWithDataId = document.querySelectorAll("[data-id='" + `section-${i}` + "']");
elementsWithDataId[0]?.classList?.add("active");
+ //滚动设置
+ const liHight = elementsWithDataId[0]?.offsetTop;
+ const pHihtt = elementsWithDataId[0]?.parentNode.parentNode.offsetHeight;
+ const ulElement = document.getElementById('help-l-ul'); // 替换为你的
元素的 id
+ const scrollHeight = ulElement.scrollTop;
+ const ulHeight = ulElement.offsetHeight;
+ if (liHight > scrollHeight + ulHeight) {
+ ulElement.scrollTop += (pHihtt + 24);
+ }
+ if (liHight < scrollHeight) {
+ ulElement.scrollTop -= (pHihtt + 24);
+ }
return;
}
}
diff --git a/public/site/zh/log.html b/public/site/zh/log.html
index 405e0bed8..31ec06d3b 100644
--- a/public/site/zh/log.html
+++ b/public/site/zh/log.html
@@ -509,6 +509,18 @@ function scrollHandler(){
rm()
let elementsWithDataId = document.querySelectorAll("[data-id='" + `section-${i}` + "']");
elementsWithDataId[1]?.classList?.add("active");
+ //滚动设置
+ const liHight = elementsWithDataId[1]?.offsetTop;
+ const pHihtt = elementsWithDataId[1]?.offsetHeight;
+ const ulElement = document.getElementById('help-l-ul'); // 替换为你的
元素的 id
+ const scrollHeight = ulElement.scrollTop;
+ const ulHeight = ulElement.offsetHeight;
+ if (liHight > scrollHeight + ulHeight) {
+ ulElement.scrollTop += (pHihtt + pHihtt);
+ }
+ if (liHight < scrollHeight) {
+ ulElement.scrollTop -= (pHihtt + pHihtt);
+ }
return;
}
}