Changing the DiviMenus Responsive Breakpoint

Customize the Breakpoint for you DiviMenu!

In this tutorial, we explain how to set a specific screen width at which one DiviMenus Flex module replaces another. This can be useful if you want to prevent the Menu Items of a horizontal DiviMenu Flex from wrapping to a new line on smaller screens.

To achieve this, we will duplicate the DiviMenu Flex module, make it vertical, and use the provided CSS code to control which version of the menu is displayed based on the screen size. Essentially, we have customized a custom breakpoint for our DiviMenu!

Follow the steps in the video tutorial!

Paste this into "DiviMenu Desktop" → Advanced → CSS ID:
dm-desktop
Paste this into "DiviMenu Mobile" → Advanced → CSS ID:
dm-mobile

By assigning this CSS ID only to the module you want to modify, you will prevent these styles from being applied to other modules on the same page.

Paste this into Page Settings → Advanced → Custom CSS:
@media only screen and (max-width: 900px) {
#dm-mobile { display: block!important; }
#dm-desktop { display: none!important; }
}
@media only screen and (min-width: 901px) {
#dm-desktop { display: block!important; }
#dm-mobile { display: none!important; }
}

Customize the values to your liking, such as changing them to 1030px and 1031px. At those screen sizes, the DiviMenus for Desktop and Mobile will be displayed accordingly.

🥳 That’s it!

DiviMenus Flex Responsiveness

Of course the DiviMenus Flex module allows you to define responsive settings for each device. For example, you can display a horizontal DiviMenu for desktop and vertical for tablets, show or hide the menu button based on the device, choose to display the DiviMenu open or closed, and adjust various settings such as font sizes, spacing between menu items, paddings, and more. We recommend watching this video to learn more about the responsive functionalities of DiviMenus:

🎬  DiviMenus Flex: Responsively Align Your Menu Items

But if you wish to apply these responsive settings at a different breakpoint, advanced CSS and JavaScript are required since our DiviMenus module doesn’t render a separate menu for mobile versions like the default Divi module does, which allows stretching from within the module itself. Our module is more complex due to the extensive possibilities we offer, and we have not added additional settings, such as a mobile menu, to avoid overburdening the plugin, which we consider crucial. However, we are actively studying the optimal integration method to make it easier to switch between desktop and mobile menus based on custom screen widths. Stay tuned for future updates regarding this feature.

In the meantime, you can follow the steps in this tutorial or enjoy our new DonDivi Nav Menu module, included in the DonDivi Builder plugin, which already features a customizable mobile menu within the module!

👉 Subscribe to our YouTube channel

More Videos