Giter Site home page Giter Site logo

Comments (5)

johnpolacek avatar johnpolacek commented on September 24, 2024

This is standard behavior. We could add a setting to disable it. For now you can comment out line 39:

// $('html, body').animate({ scrollTop: 0 }, 0);

from superscrollorama.

pangolingo avatar pangolingo commented on September 24, 2024

An option to disable would be nice, unless it breaks something somewhere else. I assume you're doing the jump to the top for a good reason. I'll use your suggestion for now. Thanks.

from superscrollorama.

janpaepke avatar janpaepke commented on September 24, 2024

To my mind it is in the code, because up until recently superscrollorama didn't work if you would have jumped past a pin or animation using an anchor link. It might also be there to trigger the first position check.

I also stumbled over this line and I think it can be removed and "doUpdateOnNextTick" should be set to true from the start to init the first position check.

from superscrollorama.

janpaepke avatar janpaepke commented on September 24, 2024

I decided to remove this line from the code.
This line really has nothing to do what superscrollorama is supposed to do and so might be a surprising side-effect to people using it.
If the user wants to do a forced scroll to top at page load he should do it outside of superscrollorama.
If not superscrollorama calculates the correct animation and pin states/positions, even if the page is loaded with an anchor link or refreshed having scrolled down.
So there's really no reason to keep the line.

Hope you agree, @johnpolacek?

from superscrollorama.

johnpolacek avatar johnpolacek commented on September 24, 2024

Works for me.

from superscrollorama.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.