.
This commit is contained in:
@@ -208,7 +208,7 @@ function scrollByPercent(current , max) {
|
||||
document.documentElement.clientHeight
|
||||
);
|
||||
|
||||
const currentScroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||
const currentScroll = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||
const moveAmount = pageHeight / max;
|
||||
window.scrollTo({ top: moveAmount * current, behavior: "smooth" });
|
||||
}
|
||||
@@ -222,7 +222,7 @@ function scrollByPercentUpDown(isToDown , max) {
|
||||
document.body.clientHeight,
|
||||
document.documentElement.clientHeight
|
||||
);
|
||||
const currentScroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||
const currentScroll = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||
const moveAmount = Math.max(pageHeight / max,150);
|
||||
window.scrollTo({ top: currentScroll + (moveAmount * isToDown) , behavior: "smooth" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user