Global JavaScript Object

If you're interested in writing your own JavaScript powered by the Bacon Menu's data, you have access to that through the baconMenu global object.


window.baconMenu (object)

A global object for the Bacon Menu

baconMenu.menus (array)

A list of all the menus for that store. Contains data for any menu items. 

menu.handle (string)

A unique identifier for that menu.

menu.options (object)

An object containing all options including layout, colors, mobile options, etc.

menu.sub_items (object)

An object containing sub items and max children.

sub_items.items (array)

An array of sub items for a menu. These are considered "top-level" menu items.

items.sub_items (array)

A list of sub items from top-level menu items. These are considered "sub-level" menu items.

baconMenu.reset (function)

In the times where you're manipulating the DOM after the menu has loaded, you might have to reset the menus. 

baconMenu.force_load_jquery (boolean)

Whether or not to claim its own version of jQuery or use the current jQuery global object.

Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk