From 76570e2f1b72de50cb54c36229447eea69c59940 Mon Sep 17 00:00:00 2001 From: gwok Date: Thu, 29 Feb 2024 18:25:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=B7=A6?= =?UTF-8?q?=E4=BE=A7=E6=BB=9A=E5=8A=A8=E8=8F=9C=E5=8D=95=E4=B8=8D=E8=B7=9F?= =?UTF-8?q?=E9=9A=8F=E5=8F=B3=E4=BE=A7=E6=AD=A3=E6=96=87=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E4=B8=8A=E6=BB=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/site/css/log.css | 5 +++++ public/site/en/help.html | 12 ++++++++++++ public/site/en/log.html | 12 ++++++++++++ public/site/zh/help.html | 12 ++++++++++++ public/site/zh/log.html | 12 ++++++++++++ 5 files changed, 53 insertions(+) diff --git a/public/site/css/log.css b/public/site/css/log.css index 46b0b9b91..b074d42b8 100644 --- a/public/site/css/log.css +++ b/public/site/css/log.css @@ -135,6 +135,11 @@ .logs-sticky{ position: sticky; top: 80px; + height: calc(100vh - 136px); +} +#help-l-ul{ + overflow-y: auto; + height: calc(100% - 36px); } .footer-layut{ border-top: var(--border-color) solid 1px; diff --git a/public/site/en/help.html b/public/site/en/help.html index e778a924f..649d98287 100644 --- a/public/site/en/help.html +++ b/public/site/en/help.html @@ -2440,6 +2440,18 @@
"[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/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 @@

DooTask Update Log

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 @@
在DooTask页面左侧点击【文件】,勾 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 @@

DooTask更新日志

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; } }