menuItems doesn't work on mobile?

Question:
menuItems works fine for desktop display. But for mobile, it doesn’t seem to work for me. What I am trying to do is pretty straightfoward:

$w(‘#horizontalMenu1’).menuItems = [
{ label: ‘Home’, link: /, selected: true },
{ label: ‘Sign Up’, link: /signup },
{ label: ‘About Us’, link: /aboutus },
{ label: ‘FAQ’, link: /faq },
{ label: ‘Contact’, link: /contact },
{ label: ‘Blog’, link: /blog }

];

It works like a charm on desktop, but has no effect for mobile devices. Any recommendations?

This post might have the solution. When on mobile Menus are inside a MenuContainer and when on desktop they’re not.

OK, that does provide a solution. I set menuitems for both the desktop menu and the mobile expandablemenu. Thanks.

1 Like