Skip to content

Scrolling is not working on Firefox #4

Open

Description

@icoloma

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.

Activity

  1. changed the title [-]Does not work on Firefox[/-] [+]Scrolling is not working on Firefox[/+] on Sep 2, 2014
  2. marekhrabe commented on Sep 2, 2014

    @marekhrabe
    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)

  3. icoloma commented on Sep 2, 2014

    @icoloma
    Author

    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.

  4. gijsroge commented on May 22, 2015

    @gijsroge

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

    PR: #9

  5. nikoloza commented on Jul 31, 2017

    @nikoloza

    +1

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions