Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling is not working on Firefox #4

Open
icoloma opened this issue Sep 2, 2014 · 4 comments
Open

Scrolling is not working on Firefox #4

icoloma opened this issue Sep 2, 2014 · 4 comments

Comments

@icoloma
Copy link

icoloma commented Sep 2, 2014

Firefox will not scroll on body but on html: http://stackoverflow.com/questions/12222485/why-to-use-html-body-for-scrolltop-instead-of-just-html

With the current code examples it's impossible to know which one to use, and one has to correct that manually.

@icoloma icoloma changed the title Does not work on Firefox Scrolling is not working on Firefox Sep 2, 2014
@marekhrabe
Copy link
Contributor

In pseudo code, we could add something like this at the beginning of function

if element is document.body then animatedScrollTo(document.documentElement, samePosition, sameTime)

With that change we will be animating both properties at same time for compatibility and user of library will be still using just document.body to initialize animation (just like in the example)

@icoloma
Copy link
Author

icoloma commented Sep 2, 2014

That means calling everything twice, including requestAnimationFrame. In my head, it makes more sense to also accept an array of values and in that case iterate the values. Change the recommendation to use [ document.body, document.documentElement ] and it's done.

@gijsroge
Copy link

Added a pull request that detects document.body & document.documentElement
So it adds support for Firefox and IE.

PR: #9

@nikoloza
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants