Closed david-pm closed 4 years ago
Thanks a lot for bringing this to my attention. I remember reading about scrollingElement
a while back but it kind of fell off my radar.
This plugin also includes a firstScrollable()
method that you can use like $('html, body').firstScrollable()
. So, it would use the "html" selector, which is effectively the same as document.documentElement
. The plugin uses that by default, so if you omit the scrollElement
option in your code, it should work. In any case, I think I'll use document.scrollingElement
if it's available for the firstScrollable()
method. And I like your idea of including a warning in the README. So, thanks again for the heads up.
Oh ha, I guess I added document.scrollingElement
detection about a year and a half ago: https://github.com/kswedberg/jquery-smooth-scroll/blob/f040c54c4ecc8372326577a49b83d52fa3a9ac3b/src/jquery.smooth-scroll.js#L62-L65
But, yeah, will still add something to the readme.
I hope this might come in handy for someone, or might be something worth mentioning in the README. This library stopped working for me overnight.
Dug around and found this issue: https://github.com/simov/simplr-smoothscroll/issues/27
which turned me onto the changes regarding document.scrollingElement
I was previously doing something like:
Taking document.scrollingElement into consideration the fix for me was essentially to just use it like this: