You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So it seems that using the element document.body no longer works on Chrome and Firefox. It still works just fine on Safari and IE.
The fix for Chrome seems to be using document.documentElement instead of document.body. The issue now is that the fix no longer works in Safari. I can include a simple if else statement to ensure each browser has a valid animatedScrollTo function called, but I wonder if there is a more elegant solution that could be used or included in the animatedScrollTo library.
Example of my animateScrollTo call after syntax change.
Probably the "future-proof" fix could be using document.scrollingElement.
Currently it works fine in every modern desktop browser (but it's NOT supported in IE <= 11).
For more details take a look to the related browser compatibility table on MDN.
So it seems that using the element
document.body
no longer works on Chrome and Firefox. It still works just fine on Safari and IE.The fix for Chrome seems to be using
document.documentElement
instead ofdocument.body
. The issue now is that the fix no longer works in Safari. I can include a simpleif else
statement to ensure each browser has a validanimatedScrollTo
function called, but I wonder if there is a more elegant solution that could be used or included in the animatedScrollTo library.Example of my animateScrollTo call after syntax change.
The text was updated successfully, but these errors were encountered: