fullPage.js
fullPage.js copied to clipboard
[question] use only section anchors, no slide anchors
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?
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.
Have you tried lockAnchors:true
?
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.
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 :)
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.
I've marked it as a possible enhancement for the future.