17th May '22
/
5 comments

How to Combine Multiple Menus into Bricks’ Mobile Menu

How to Combine Multiple Menus into Bricks’ Mobile Menu

Bricks' native 'Nav Menu' element comes with a built-in mobile menu, which shrinks the menu down to a menu toggle button to open an offcanvas type container.

In this Pro tutorial, we'll look at how we can combine multiple menus into this one mobile menu, so even though we may have multiple menus in different locations for desktop devices, for mobiles it'll reduce to just one menu toggle button and all the menu items will be found inside of one mobile menu.

Example header with multiple, separate menus.. here we have three menus

For mobile, we want them all to be contained within one mobile menu and have only one menu toggle button to reveal them.

mobile-menu

Choosing the Mobile Menu

The first step is to choose which of our menus is our 'main menu', which will be used for our one mobile menu. A sensible way to choose could be just based on where we want our menu toggle button to be placed. If we have multiple header rows, it'll be the menu that is positioned inside of the header row where we want our menu toggle to appear on mobile.

Then we note the element's ID for use later, it'll look something like 'brxe-jlvunl' (written in the class dropdown).

Lastly, we choose the width where the mobile menu needs to kick in, for eg choosing 'Mobile landscape' from the 'Show Mobile Menu Toggle' dropdown will ensure the mobile menu toggle is visible at 478px and below.

Choosing the 'Other Menus'

Not every menu on the page may need to be included in our mobile menu. For example, some menus inside of the footer may need their own menu toggle, or maybe have no separate mobile version at all.

The way to select which menus are included is to give them a class. Any menus where the menu items need to be included inside of our mobile menu, we'll give them a class 'move-menu'. We also need to set the width for where the mobile menu kicks in, to match our main menu. For example, select 'Mobile landscape' again. (important - this needs to be the same as the main menu to make sure the menu items are all hidden at the same width)

Combining into One Mobile Menu

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Centered Image Logo in Bricks

Centered Image Logo in Bricks

Updated on 8 Mar 2023 This Pro tutorial provides the steps to add a logo image as the center menu item that shrinks when the…
Categories:
How to create filters with IsotopeJS in Bricks (Part 4): AJAX filter and infinite loops, Sorting, List view and Disable animations

How to create filters with IsotopeJS in Bricks (Part 4): AJAX filter and infinite loops, Sorting, List view and Disable animations

This tutorial will explain how to enable the AJAX filter with an infinite scroll query loop container, how to add a sorting function, how to…
Categories:
Pro
Masonry + Click-type Infinite Scroll in Bricks

Masonry + Click-type Infinite Scroll in Bricks

This Pro tutorial provides the steps to lay out posts in a masonry style with a View More button, which, when clicked, loads the next…
Categories:
Pro
Codrops Dynamic Shape Overlay in Bricks

Codrops Dynamic Shape Overlay in Bricks

This Pro tutorial provides the steps to implement Codrops' SVG shape overlay in Bricks. We shall display a WordPress menu in the overlay after an…
Categories:
Pro
Inserting Random Ad Between Posts in Bricks

Inserting Random Ad Between Posts in Bricks

How to insert random ads (post type) in between regular posts on the blog page.
Categories:
Download Area with HappyFiles

Download Area with HappyFiles

Aside from the series I'm currently writing on how to create custom galleries and sliders with HappyFiles, Metabox and Bricks, I have developed a snippet…
Categories:
Pro
Image Banner as Query Loop Posts Grid’s Last Item in Bricks

Image Banner as Query Loop Posts Grid’s Last Item in Bricks

In the comments section of How to Insert Element(s) Between Query Loop Posts in Bricks tutorial, a site member asked: This is fantastic! Is there…
Categories:
Tags:
Pro
Sticky Scrolling in Bricks Builder

Sticky Scrolling in Bricks Builder

Updated on 22 Apr 2024 This Pro tutorial provides the steps to fix elements in the viewport i.e., make them sticky while adjacent content in the section…
Categories:
Tags: