Is there a problem with the menu APIs when using mobile?

Question:
Is there a problem with the menu APIs when using mobile? MenuItems are undefined.

Product:
Velo APIs

What are you trying to achieve:
Trying to access mobile menu items.

What have you already tried:
This code snippet shows menuItems are undefined for ‘#mobileMenu1’. ‘#mobileMenu1’ is defined, and I’m accessing the site with a mobile device.

$w.onReady(function () {
   console.log( $w('#mobileMenu1').menuItems )
});

Additional information:
I asked this question earlier, but with less well defined wording. This should be easy to replicate. Go to dev mode. Add the above velo code. Change to mobile view. Run the code. I believe #mobileMenu1 is the default name of the mobile menu, but it might be different for you.

https://dev.wix.com/docs/velo/api-reference/$w/menu/menu-items

Seems to be working for me.

Is this the Wix editor or Studio editor? Got a screenshot of the element in the editor and/or the error?

Thanks, I got it working by upgrading to the newer mobile menus.

IDK about the differences between the editors. This one says WIX STUDIO in the upper left. I think it’s the only one I’ve ever used.

Amazing - glad to hear it’s working :slight_smile:

When in the editor itself, if you see a square with a circle in it (Studio logo) it’ll be the Studio editor (it also has a dark bar at the top). If it’s a light coloured bar, and has the word “Wix” in the top corner, it’ll be the Wix Editor :slight_smile:

1 Like

I’m guessing it’s the WIX editor then? Should I care? It works for me as-is.

Nah, you should be good either way - as long as it’s working, that’s the main thing :slight_smile:

Sometimes knowing which editor is being used is helpful, since there are some differences here and there

You’re the best! Your working knowledge of this platform and the help you provide is remarkable.