Off canvas menus appear all over the place on the web, on the other hand building one that works simply on desktop incessantly manner combating with custom designed CSS or patching together mega-menu workarounds. Divi 5 handles this otherwise with Canvases and Interactions.
We’ll assemble a global off canvas services and products and merchandise menu prompted from a Theme Builder header template. The menu sits in its non-public canvas, completely separate from your internet web page layout, and stays fastened while visitors scroll. On cell, it is going to get a max-height and within scroll so the whole lot stays available in the market on smaller displays.
What Are Canvases In Divi 5?
A canvas in Divi 5 is a separate workspace that exists outside your main internet web page layout. Your internet web page content material subject material lives in the primary builder house, on the other hand canvases serve as independently and stay hidden until prompted.
Recall to mind them as faithful bins for interface elements that the majority efficient appear when sought after. You assemble off canvas menus, slide-in panels, popups, or drawers inside of a canvas, they normally wait inside the background until a button click on on or interaction pulls them into view. The internet web page doesn’t signal of their presence until that 2d.
After updating your Divi 5 theme to the most recent style, you’ll see a brand spanking new Canvas dropdown inside the peak bar.

The dropdown permits you to switch between canvases you’ve created. The Canvas Grid View risk shows all canvases in a single dashboard for speedy get right to use.
You’ll be capable of create each and every local and world canvases. Local canvases belong to a decided on internet web page or template. Global canvases artwork all the way through your whole web page, in order that you assemble a navigation panel once and reuse it all over the place without duplicating design artwork.
Canvases connect directly to Divi’s Interplay device. Purpose them with clicks, hovers, scrolls, or other events. They appear dynamically on the front end on the other hand keep organized inside the builder as their own layer, so updating a menu design doesn’t ripple into the pages where it seems that.
Why Use Divi Canvas For Off Canvas Menus?
The former technique to mega menus incessantly meant embedding them directly into your header layout. A spacing tweak or responsive adjustment would possibly destroy the menu totally, and fixing it meant digging by way of nested sections to untangle navigation excellent judgment from layout code. Canvases do away with this by way of giving the menu its non-public isolated space.
This separation makes maintenance easier as your web page grows. Substitute the menu’s layout, links, or styling once in a global canvas, and the changes take have an effect on all over the place. Canvases moreover do away with the will for workarounds identical to personalized CSS, antagonistic margins, or third-party plugins. Purpose the menu by way of Divi’s Interaction instrument and let the builder handle the remainder.
Be informed The entirety About Divi 5 Canvases
What We’re Building
We’re building a global off canvas slide-in menu prompted by way of a button inside the web page header. The button sits in a Theme Builder header template, because of this the menu works site-wide without rebuilding it on explicit individual pages.
The menu lives in a canvas set to “Don’t Append”, so it stays out of your internet web page layout until an interaction finds it. When prompted, it seems that as a collection overlay that is still on-screen as visitors scroll. On cell, we’ll add a max-height and within scroll container so the menu remains available in the market although content material subject material extends previous the viewport.
By way of the end, you’ll have a menu that behaves consistently all the way through breakpoints and doesn’t interfere with internet web page layouts.
1. Create The Header In Theme Builder (And Add The Button)
Open Divi > Theme Builder and edit your provide Global Header. We’re operating at the template level so the menu button turns out on every internet web page without information placement.

Throughout the header layout, add a Button module and place it inside of an provide header row next on your Menu module. Label it View Services and magnificence it to match your header design. This button will reason the off canvas menu, so its placement and styling should in reality really feel natural within your navigation.

2. Create A New Canvas For The Menu
With the reason button in place, we’d like somewhere for the menu to live. Throughout the Visual Builder, open the Canvas dropdown from the best bar and click on on Add Canvas.

Name the canvas Submenu, so it’s easy to identify when putting in interactions later. Make it Global so it’s available in the market all the way through your whole web page, and set it to Don’t Append.
This atmosphere keeps the canvas completely detached from your internet web page development, which prevents it from interfering with internet web page layouts while nevertheless making it available for interactions to concentrate on. Click on on Add Canvas when completed.

Divi automatically switches you into the canvas workspace. You at the moment have a blank house where you’ll assemble the menu development.
3. Design The Off Canvas Menu Structure
Get began by way of together with an ordinary section with a black background color set to 70% opacity. This creates the overlay have an effect on that dims the internet web page content material subject material when the menu opens.

Set the section’s Width to 100vw and Most sensible to 100vh so it covers all of the viewport. Throughout the section, add a single-column row. This row will grab the real menu content material subject material. Set the Background to White and add a 10px Border Radius for visual polish. Move to Design > Structure and set each and every Horizontal and Vertical Gaps to clamp(20px, 4vw, 50px).

This fluid spacing worth keeps the layout breathing naturally all the way through show sizes without information breakpoint adjustments.
Add a Text module at the peak for a heading like “All Choices”, then place an Icon module next to it for the close button. This close button will reason the interaction that hides the menu, so keep it visually distinct and available in the market.

Beneath the header row, add a 4-column row to development your supplier possible choices. Divi 5’s Flexbox instrument handles the column layout, so the 4-column layout automatically turns into two and single-column layouts according to available space.

In each column, add a Blurb module with the supplier name for the reason that determine and a temporary description inside the body text. Beneath each blurb, add a Button module categorized “Learn Further.”

Repeat this development all the way through the remaining menu items to complete the menu development.

4. Set The Menu To Fixed Position
The menu needs to stay anchored on show while visitors scroll the internet web page beneath it. Without fastened positioning, the menu would scroll with the internet web page content material subject material, breaking the overlay behavior.
Select the Section and set Position to Fixed. Then set the Z Index to 9999 so the menu turns out above all other internet web page elements, in conjunction with sticky headers or other fastened elements.

If your panel shifts while scrolling, practice the identical positioning settings to the Row that holds the menu panel. That is serving to care for the layered development.

5. Optimize The Menu For Cellular With Max Most sensible And Scroll
With the menu development and positioning in place, we wish to handle how it behaves on smaller displays. The header row needs adjustments to prevent stacking on cell.
Switch to tablet view and select the header row. Move to Design > Structure, set Align Items to Center for consistent vertical alignment, and make allowance No Wrap to stick the ones elements side-by-side relatively than stacking vertically.
This assists in keeping the heading and close button in a single horizontal row all the way through all show sizes.
Now we wish to deal with all the height. On smaller displays, all of the menu panel can exceed the viewport height, pushing content material subject material off-screen. Select the Row that contains all the menu content material subject material (the white container with the heading row and menu items), and set the Max Most sensible to 80%.

This constrains the menu to 80% of the viewport height, leaving breathing room at the peak and bottom. Now go to Complicated > Visibility > Vertical Overflow and select Scroll.

This creates an within scroll container. Visitors can now scroll all the way through the menu content material subject material without the panel itself extending previous the show barriers.
Apply the ones equivalent settings (Max Most sensible 80% and Vertical Overflow Scroll) to cell view to make sure the menu works consistently all the way through all small show sizes.
6. Duvet The Canvas On All Breakpoints
The menu is built and optimized, on the other hand it’s at the moment visible inside the builder. Since this is an off canvas menu that should most efficient appear when prompted, we wish to hide it by way of default all the way through all breakpoints.
Open the Section settings, go to the Complicated tab, and to seek out the Visibility possible choices. Disable visibility on desktop, tablet, phone, and other breakpoints.

This hides the menu from view, on the other hand interactions can nevertheless function it and toggle its visibility. While you’re inside the Section settings, moreover set Complicated > Visibility > Vertical Overflow to Auto so the section itself can handle overflow gracefully if sought after.
Selection Means: You’ll be capable of moreover hide the section the use of custom designed CSS. Move to Complicated > CSS > Module Portions and sort display: none; inside the Main Part field. This achieves the identical consequence the use of CSS relatively than visibility controls.
This assists in keeping the menu hidden all the way through all breakpoints. Although interactions haven’t fired however, the menu won’t appear. Recall to mind this as your baseline state: hidden till instructed otherwise.
7. Add Interactions To Open And Close The Menu
With the menu built and hidden, we wish to twine up the interactions that keep watch over its visibility. Divi’s Interactions instrument works by way of 3 components: a reason (what initiates the movement), an have an effect on (what happens), and a function (what element is affected). We’ll organize two interactions, one to show the menu when the button is clicked and one to hide it when the close icon is clicked.
First, give the menu section a clear Admin Label so it’s easy to concentrate on inside the interaction settings. Select the Section that holds your menu content material subject material, go to Settings > Content material subject material > Admin Label, and name it Submenu Section.

This label makes the section identifiable whilst you’re selecting targets all the way through different canvases.
Now switch once more to the Main Canvas the use of the dropdown at the peak of the builder. This takes you to the internet web page where your header lives.

Select the View Services button on your header. Move to Settings > Complicated > Interactions and click on on Add Interaction.

Throughout the interaction editor, set the Purpose Match to Click on on. This tells Divi to begin up the interaction when somebody clicks the button. For Affect Movement, make a selection Show Part, which makes a hidden element visible. Then select Submenu Section for the reason that Function Module.
That’s the position the Admin Label you set earlier becomes essential. Pass away the Time Extend at 0ms for speedy response, then click on on Save.

When the interaction runs on the front end, Divi so much the canvas content material subject material and toggles the section’s visibility. The menu turns out as a collection overlay without disrupting the internet web page development.
Previous than transferring on, add but yet another interaction to keep watch over the menu’s default state.
Select the View Services Button over again and add a brand spanking new interaction. Set the Purpose Match to Load, make a selection Duvet Part for the reason that Affect Movement, and keep Submenu Section for the reason that Function Module.
This forces the menu proper right into a hidden state on every internet web page load. Although the canvas was visible throughout preview or a previous interaction, it resets on refresh and no longer flashes on show. The earlier visibility settings define the baseline, and this interaction controls the menu’s state at runtime so it all the time starts closed.
Now organize the close interaction. Switch once more to the Submenu Canvas the use of the dropdown, and select the close icon next to the “All Choices” heading.
Move to Settings > Complicated > Interactions and add another interaction. Set the Purpose Match to Click on on, make a selection Duvet Part for the reason that Affect Movement, and select Submenu Section for the reason that Function Module. Keep the Time Extend at 0ms, then save.

This interaction reverses the visibility toggle. When clicked, the menu disappears, and the canvas detaches from the internet web page until prompted over again.
The interactions in this day and age are live. The button shows the menu, the close icon hides it, and each and every artwork all the way through your whole web page given that canvas is world and the button lives inside the Theme Builder header.
Preview The Menu On The Front End (Desktop & Cellular)
With the interactions configured, save each and every the Theme Builder header and the canvas. Now check out the menu on the front end to confirm it behaves as it should be all the way through gadgets.
Open any internet web page to your web page and click on at the View Services button inside the header. The menu should slide in as a collection overlay that sits above the internet web page content material subject material. Scroll the internet web page while the menu is open to make sure it stays anchored in place instead of transferring with the internet web page. This confirms that the fastened positioning is working and the menu functions as an actual overlay, not as part of the internet web page layout.
Switch to a cell tool or use your browser’s responsive view, then tap the View Services button over again. The menu should stay contained all the way through the viewport without extending previous the show barriers. If the content material subject material is taller than the show, you’ll have to be able to scroll all the way through the menu items all the way through the overlay while the overlay remains fastened.
Trying out on each and every desktop and cell validates that the canvas instrument, Flexbox settings, and interactions artwork together as it should be. The menu now functions as a licensed navigation component that adapts to any show dimension without breaking your internet web page development.
Download The Tutorial Template
If you want to use this tutorial’s header template, you’ll be capable of download it beneath!
@media most efficient show and ( max-width: 767px ) {.et_bloom .et_bloom_optin_1 .carrot_edge.et_bloom_form_right .et_bloom_form_content:forward of { border-top-color: #ffffff !very important; border-left-color: transparent !very important; }.et_bloom .et_bloom_optin_1 .carrot_edge.et_bloom_form_left .et_bloom_form_content:after { border-bottom-color: #ffffff !very important; border-left-color: transparent !very important; }
}.et_bloom .et_bloom_optin_1 .et_bloom_form_content button { background-color: #f92c8b !very important; } .et_bloom .et_bloom_optin_1 .et_bloom_form_content .et_bloom_fields i { color: #f92c8b !very important; } .et_bloom .et_bloom_optin_1 .et_bloom_form_content .et_bloom_custom_field_radio i:forward of { background: #f92c8b !very important; } .et_bloom .et_bloom_optin_1 .et_bloom_border_solid { border-color: #f7f9fb !very important } .et_bloom .et_bloom_optin_1 .et_bloom_form_content button { background-color: #f92c8b !very important; } .et_bloom .et_bloom_optin_1 .et_bloom_form_container h2, .et_bloom .et_bloom_optin_1 .et_bloom_form_container h2 span, .et_bloom .et_bloom_optin_1 .et_bloom_form_container h2 powerful { font-family: “Open Sans”, Helvetica, Arial, Lucida, sans-serif; }.et_bloom .et_bloom_optin_1 .et_bloom_form_container p, .et_bloom .et_bloom_optin_1 .et_bloom_form_container p span, .et_bloom .et_bloom_optin_1 .et_bloom_form_container p powerful, .et_bloom .et_bloom_optin_1 .et_bloom_form_container form input, .et_bloom .et_bloom_optin_1 .et_bloom_form_container form button span { font-family: “Open Sans”, Helvetica, Arial, Lucida, sans-serif; } p.et_bloom_popup_input { padding-bottom: 0 !very important;}
Download For Unfastened
Join the Divi Publication and we can email you a reproduction of the ultimate Divi Landing Internet web page Structure Pack, plus lots of different superb and loose Divi property, guidelines and guidelines. Practice along and you will be a Divi grab in no time. If you’re already subscribed simply kind on your email deal with beneath and click on on download to get right to use the layout pack.
You’ve got successfully subscribed. Please check your email deal with to confirm your subscription and get get right to use to loose weekly Divi layout packs!
Take a look at Canvases In Divi 5 Lately!
Canvases and Interactions in Divi 5 handle off canvas menus cleanly. The canvas keeps the menu separate from your internet web page development, fastened positioning makes it behave like an overlay, and Flexbox handles responsive behavior without custom designed CSS. Set it up once in a global canvas, reason it from your Theme Builder header, and it in reality works site-wide.
This equivalent approach applies to product menus, function showcases, or any navigation element that are meant to slide in on name for. The mechanics stay the identical: assemble in a canvas, set visibility laws, and wire up the interactions.
The post How To Create An Off Canvas Products and services Popup In Divi 5 appeared first on Chic Issues Weblog.


0 Comments