mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
fix:修复左侧滚动菜单不跟随右侧正文自动上滑
This commit is contained in:
parent
81690d6ce9
commit
76570e2f1b
5
public/site/css/log.css
vendored
5
public/site/css/log.css
vendored
@ -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;
|
||||
|
||||
@ -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'); // 替换为你的 <div> 元素的 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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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'); // 替换为你的 <div> 元素的 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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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'); // 替换为你的 <div> 元素的 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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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'); // 替换为你的 <div> 元素的 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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user