Right now the library does 2 things (which make total sense):
However, when the user scrolls and the library changes the page, it does not update the window location hash. This means that if someone scrolls to the next page, they won't be able to deep link to that page. They will be able to deep link if they click on a link with a target as the href, but not scrolling.
Here's a user story if this helps:
<a href="#page2">Page Two</a>, which changes the URL to http://example.com/#page2 and triggers the window.hashchange event.window.hashchange event animates to the next page.http://example.com/#page2 will successfully see the second page.Not working story:
window.scroll animates to the next page.http://example.com) with the intention of showing people the second page.Ref: #175. Is that clearer?
Not working story:
1 User visits website, first page is shown by default.
2 User scrolls on window with intention of visiting next page.
3 FullPage.js' listener on window.scroll animates to the next page.
4 User copies url (which is still http://example.com) with the intention of showing people the second page.
5 People who click on the shared link will not see page 2, instead they will see the default first page.
I don't know how are you able to reproduce it. The point 4 is wrong. The URL should be with an anchor link (#).
If you try it by using the demo page, you will see the URL hash changing every time you make any scroll with the mouse.
And that's not because of the window.scroll event, but because of the mousewheel one.
Even if you use autoScrolling:false the URL hash keep updating on scroll as you can see in this other example online. This time triggered by window.scroll.
Show me an example reproducing your problem. I really don't understand which is the trouble you are having.
We weren't using autoScrolling:false, but I re-looked at your demo code and not specifying the anchors fixed this issue. That's a very interesting behavior.
If I have some time I'd like to help you flush out more of the docs. The options aren't self-explanatory and the required options don't seem noted.
Anyway, thanks for being responsive to my questions!
not specifying the anchors fixed this issue
Anchors are required if you want them to work. What do you mean?
Sorry, specifying the anchors fixed the issue. The problem was we weren't specifying the anchors manually.
Should it work if I use data-anchor on sections instead of referencing them specifically on initialization?
Hello,
I realise this is an old one but I'm facing the same issue.
I've implemented fullPage as a Drupal 8 module. It's working fine except for the URL which is not updated. Neither on scroll for the sections nor using the arrows for the slides.
autoScrolling is on default value, hence true.
anchors are named using data-anchor
Regards,
@glouton if you believe it is a bug please open a new issue with an isolated reproduciton of it with the minimum amount of HTML code and no external CSS or JS to fullpage.js.
Most helpful comment
Should it work if I use data-anchor on sections instead of referencing them specifically on initialization?