Fullpage.js: Menu without using anchors

Created on 19 Jun 2017  路  15Comments  路  Source: alvarotrigo/fullPage.js

If you enable lockAnchors with lockAnchors:true although this removes the hash from the URL, which is the expected output, it also disables the ability to click the navigational dots. Shouldn't these still work? I basically just need to turn off the hash in the URL.

enhancement fixed on dev

All 15 comments

I have my own menu setup menu: 'section.home .navigation' too by the way. Maybe I could hook into the moveTo function however I feel removing the hash only should be an option.

Working as expected: http://jsfiddle.net/97tbk/1924/

Closed until an isolated reproduction is provided as detailed in the reporting issues guidelines and the issue skeleton.

Not sure what this jsFiddle is supposed to show but it doesn't have a custom menu set up?

I though you were talking about the horizontal navigation, the option slidesNavigation:true.
Menu won't work without anchors.

But you can always create your own menu and use the $.fn.fullpage.moveTo funcction by yourself attaching it on click events.

The menu option allows you to link menu elements with any section or slide in the page.
If you do not want to use anchors, then you would have to use an index value to link to the menu.

I guess I can add that feature. I'll mark as an enhancement.

Hi can you expand on how and where this $.fn.fullpage.moveTo function would be included in my code?

I am trying to make my own navigation menu and I do not want to use anchors, which leave history in the user's browser. If they press 'back' I want it to just take the user away from the page, but I still want to have a navigation menu.

Thanks for any assistance.

Hi can you expand on how and where this $.fn.fullpage.moveTo function would be included in my code?

Example in the docs. Take a look at the demo.

Also take a look at my answer here:
https://stackoverflow.com/a/36742906/1081396

Hi again. Many Thanks. I'm still finding that the sections which have been clicked on from the menu are recorded in the browser history. The page doesn't scroll back through them as I press back, but I have to click back several times to exit the page.

This is what I have; any advice much appreciated.

```


```

@levelgain if you believe it is a bug please create a new issue and provide an isolated reproduction as detailed in the reporting issues guidelines and the issue skeleton.

Please use the minimum HTML code and no external JS and CSS. Get rid of everything else and ideally use empty sections.
This way I'll be sure the problem is not in your code and that it is indeed in fullpage.js.
It will also help me resolved your issue much faster.

Ok sorry; I've tried to simplify my code. I'm sure there is no bug and that I have made an error; I just haven't worked it out. As I said, when I scroll there is no history recorded to the browser, but when I click on menu, sections are recorded to the browser history, which is what I'd like to avoid. Thanks again.

$(document).ready(function() {
            $('#fullpage').fullpage({
                sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE'],
                anchors: ['firstPage', 'secondPage', 'thirdPage'],
                menu: '#myMenu',
                recordHistory: false
<ul id="myMenu" style='position: fixed; z-index: 300;'>          
        <li data-menuanchor="firstPage" class="active"><a href="#firstPage">firstPage</a></li>
        <li data-menuanchor="secondPage"><a href="#secondPage">secondPage</a></li>
        <li data-menuanchor="thirdPage"><a href="#thirdPage">thirdPage</a></li>
      </ul>

I'll wait for the isolated reproduction.

As this is not yet supported, meanwhile you can get this by jQuery.

When you have lockAnchors: true, , you can do this :
$('ul li a').click(function(){ let newSlide = $(this).closest('li').data("menuanchor") $.fn.fullpage.moveTo(newSlide, 1); });

@MadanBhandari exactly :)

Fixed on the dev version 3.0.4.
It will get merged soon in the next release!

Now fixed in fullPage.js 3.0.4!

Was this page helpful?
0 / 5 - 0 ratings