diff options
Diffstat (limited to 'js')
| -rwxr-xr-x | js/parallax-header.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/js/parallax-header.js b/js/parallax-header.js index c4ce1fc..52990f8 100755 --- a/js/parallax-header.js +++ b/js/parallax-header.js @@ -13,6 +13,7 @@ document.addEventListener("scroll", () => { function animate() { currentPercent += (targetPercent - currentPercent) * tweenSpeed; + currentPercent = Math.max(Math.min(targetMax, currentPercent), targetMin); document.documentElement.style.setProperty('--scroll-percent', currentPercent + '%'); requestAnimationFrame(animate); } |
