user3799112 user3799112 - 13 days ago 5
CSS Question

fullpage.js active state on duplicate menu's

Working with fullpage.js I have a menu in de header. Setup as in doc. Working fine. When I go on small screens I hide de menu with css. With css I pu a menubutton triggering a js dropdown. In the dropdown I have the same code for menu as in the desktop header. Everything works fine, but I can't get the active state to work in that menu.

Can I get the same menu working on two places on a site (when you hide one, its still in the code) or do I have to remove the div with js?

URL

development.darktown.ch

Answer

You are not following the documentation regarding how to use the menu option. You have:

menu: ['#menu','#m-menu'],

And the documentation states:

menu: (default false) A selector can be used to specify the menu to link with the sections.

Yours is not a selector but an array of selectors.

Just use a class instead:

menu: '.menu'

And use a class in both elements instead of an id. (or additionally to it)