Coder Social home page Coder Social logo

Overlapping rAF bug about smoothscroll HOT 3 CLOSED

iamdustan avatar iamdustan commented on July 24, 2024
Overlapping rAF bug

from smoothscroll.

Comments (3)

iamdustan avatar iamdustan commented on July 24, 2024

If there's a scrolling taking place the function stops working.

Is this a user initiated scroll or a programmatic scroll?

User initiated scroll: user is scrolling and clicks a local anchor while scrolling, or
Programmatic scroll: attempt to call the scrollTo method again before the last one completes? scrollTo(0, position, 'smooth'); scrollTo(0, otherPosition, 'smooth');

from smoothscroll.

iamdustan avatar iamdustan commented on July 24, 2024

Just pushed an update and it should be on bower, too. Let me know if that fixes it for you.

Iā€™m not 100% sure that that is what the spec defines as proper behavior so it may change in the near future once I read through it again.

from smoothscroll.

jeremenichelli avatar jeremenichelli commented on July 24, 2024

I've used your script when an anchor was clicked, but during the animation a person could click on other anchor. Breaking the browser scroll bar functionality sometimes. I've fixed in my local js file declaring frame as a global variable, and cancel the animation before requesting it. But I think the conditional could work too and works inside the function scope :)

from smoothscroll.

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.