window.scrollTo
MDN says "DOM Level 0" under Specification, which according to Quirksmode means it's supported in Netscape 2+ which essentially means all browsers since then (1995!) support this.
-1
I request we reopen this -- while window.scrollTo is supported far back by many browsers, many versions (like Chrome on Android 6-8) throw errors when you use this format:
// this changes the scrolling behavior to "smooth"
window.scrollTo({
top: 1000,
behavior: "smooth"
});
Instead of using:
window.scrollTo( 0, 1000 );
Some of these errors include:
Uncaught TypeError: Failed to execute 'scrollTo' on 'Window': 2 arguments required, but only 1 present.
Uncaught TypeError: Failed to execute 'scrollTo' on 'Window': No function was found that matched the signature provided.
I'm testing whether providing a third argument (like left) resolves this, but I think this belongs here.
window.scrollTo( 0, 1000 );
I just tested IE11 and Edge,supported. However , it will scroll to top if you pass an object .
Most helpful comment
I request we reopen this -- while window.scrollTo is supported far back by many browsers, many versions (like Chrome on Android 6-8) throw errors when you use this format:
Instead of using:
Some of these errors include:
I'm testing whether providing a third argument (like
left) resolves this, but I think this belongs here.