Caniuse: window.scrollTo

Created on 28 Jul 2015  路  4Comments  路  Source: Fyrd/caniuse

window.scrollTo

Support data suggestion

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:

// 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.

All 4 comments

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 .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

valtido picture valtido  路  3Comments

bappygolder picture bappygolder  路  3Comments

36degrees picture 36degrees  路  3Comments

Schweinepriester picture Schweinepriester  路  3Comments

LifeIsStrange picture LifeIsStrange  路  3Comments