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

[question] use only section anchors, no slide anchors

Open marconett opened this issue 3 years ago • 6 comments

As I am scrolling through slides automatically (without user interaction), I would like there to be no changes to the url when changing slides, but still be able to use section anchors. Is this possible, or could it be added as a feature?

marconett avatar Aug 18 '21 09:08 marconett

Doesn't seem to be possible. Introducing a new option (Boolean) disableSlideAnchors and adding another condition around here would make this possible: https://github.com/alvarotrigo/fullPage.js/blob/cc20f6cb46dd1fdc84599ad82aff5b0412970915/src/fullpage.js#L2964

I would patch it myself, but I am relying on fullpage.extensions.min.js, which i can't build by myself because I don't have the source.

Currently, my only option is to try and patch the minified js (which is horrific), or waiting for Álvaro to add this and release it.

marconett avatar Aug 18 '21 10:08 marconett

Have you tried lockAnchors:true?

alvarotrigo avatar Aug 18 '21 10:08 alvarotrigo

Thank you for the quick reply. lockAnchors: true disables section-anchors as well. I only want to disable slide-anchors.

It seems to be possible to achieve my desired behavior with:

onLeave() {
  window.fullpage_api.setLockAnchors(false);
}

onSlideLeave() {
  window.fullpage_api.setLockAnchors(true);
}

But I'm not sure if this works reliably or has any side-effects.

marconett avatar Aug 18 '21 10:08 marconett

Yeah, right. There's currently no option out-of-the-box to achieve what you want.

As long as you don't see any side effects using that, you can give it a try :)

alvarotrigo avatar Aug 18 '21 10:08 alvarotrigo

I will keep the solution as is and will see if there are problems with it while testing before release. If there are, I will report back.

Thank you.

marconett avatar Aug 18 '21 10:08 marconett

I've marked it as a possible enhancement for the future.

alvarotrigo avatar Aug 18 '21 10:08 alvarotrigo