Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a hashtag-link for some other functionality than fullpage-navigation #4334

Open
SNagel opened this issue Mar 14, 2022 · 1 comment
Open
Labels

Comments

@SNagel
Copy link

SNagel commented Mar 14, 2022

So i hope this is my last question, my fullpage.js-project is almost complete by now (and it's working great :)
One thing left to do ...

i have a header section (fixed above the fullpage container) that contains links to fullpagesections:
<a href="#sectionname">Section Name</a>
They work fine: i click on them, the URL bar extends to domain.com/#sectionname and fullpage scrolls down to that section as intended.

Now i have a footer link (to open cookie settings) and the API there requires me to open that modal with settings with:
<a href="#showcookielayer">, triggering some internal event to show the modal.

This works on a page without fullpage.js initialized, but it fails when fullpage.js is active. Instead, the #showcookielayer is added to the URL and as there is no section with that name, no scrolling occures.

So question is: is there a way to exclude a hashtag link from triggering a fullpage.js scrolling attempt?

I want / need the anchor functionality else, so turning it off is no option. It's just that one link that should not be handled by fullpage.js but leave to the browser and handle it by the other script instead.

@alvarotrigo
Copy link
Owner

alvarotrigo commented Mar 16, 2022

Sure!

You can temporally disable hashes on fullPage.js by using the method fullpage_api.setLockAnchors(false);

Then turn it on when closing the modal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants