1
0
Fork 0

Disable auto-scroll on firefox browser

This commit is contained in:
Ethanell 2020-06-09 17:26:33 +02:00
parent 3bf30bd63f
commit ba5538afa1

View file

@ -23,7 +23,7 @@ main.querySelector("#email").addEventListener("keyup", e => {
}); });
let observer = new IntersectionObserver(function(entries) { let observer = new IntersectionObserver(function(entries) {
if(entries[0].isIntersecting === true) if(entries[0].isIntersecting === true && navigator.userAgent.toLowerCase().indexOf('firefox') <= -1)
window.scrollTo({top: entries[0].target.getBoundingClientRect().top + window.scrollY, window.scrollTo({top: entries[0].target.getBoundingClientRect().top + window.scrollY,
left: 0, left: 0,
behavior: 'smooth'}); behavior: 'smooth'});