fullPage.js icon indicating copy to clipboard operation
fullPage.js copied to clipboard

Method to determine if anchor was used on page load?

Open alvarotrigo opened this issue 5 years ago • 1 comments

From this conversation

It's a work in progress but here's a staged version: http://gatsby.loganjamesnottbohm.com/projects/

If you scroll down to the second slide, then click view project, and then click back, the issue will appear. It will load the first slide initially but then immediately animate to the second slide. Ideally, my animation would not be called from onLeave being triggered when hitting back, and it would just load the second slide without any animation.

Thank you for the help by the way!

alvarotrigo avatar Jan 24 '20 21:01 alvarotrigo

I do not want to see the animation that goes from section 1 to section 2. I just want section 2 to appear.

Right I see. So you have an animation between section 1 and section 2 and you don't want it to be visible on page load when animate anchor is on section 2?

Maybe you can use the afterRender callback, see if there's any anchor in the URL and if there' s one then do not fire that animation on the onLeave.

But yeap, this would be nice to have in fullPage.js! Perhaps adding a method called isAnchorPresent()can come on handy for this kind of issues. However, I would say the callback is not the problem here :)

I'll close the issue, we can open a new one for your use case and for the potential new method.

alvarotrigo avatar Jan 24 '20 21:01 alvarotrigo