Skip to content

silentMoveTo sets the original scrollingSpeed before performMovement is called, so it's not a silentMove #1476

@rameau1982

Description

@rameau1982

The function seilentMoveTo is defined like this:

FP.silentMoveTo = function(sectionAnchor, slideAnchor){
FP.setScrollingSpeed (0, 'internal');
FP.moveTo(sectionAnchor, slideAnchor)
FP.setScrollingSpeed (originals.scrollingSpeed, 'internal');
};

But as FP.moveTo calls to scrollPage which has a call to requestAnimFrame and it is asynchronous, the scrollingSpeed is reseted to its original value (700) and the movement is done WITH animation.

The solution would be to define the function moveTo with a third argument: callback and pass this callback to the function scrollPage, which accepts a callback as the second argument of the function.
Inside the callback would be the call to FP.setScrollingSpeed (originals.scrollingSpeed, 'internal');

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions