Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Resize menu width automatically #190

Open
mattiteve opened this issue Dec 27, 2019 · 1 comment
Open

Resize menu width automatically #190

mattiteve opened this issue Dec 27, 2019 · 1 comment

Comments

@mattiteve
Copy link

Hi,

I'm experimenting, but I don't find the right solution for dynamic menu width based on a css variable. My responsive site is using a width for the menu which is >>calc(var(--bus) * 14)<<. Site recalculates "bus" (basic unit size) upon $(window).resize and menu width should be updated, menu should be redrawn. What is the right method to do so, please?

Initial options settings works only for loading, not for resizing:
$('#menu').multilevelpushmenu({
menuHeight: 'calc(var(--bus) * 14)'
});

The variable "bus" is not based on % of total width and not based on vw (width of the viewport), but it is calculated based on a space needed for my content.

Many thanks!

@adgsm
Copy link
Owner

adgsm commented Dec 30, 2019

Maybe

/**
 * Redraw menus
 *
 */
$('#menu').multilevelpushmenu( 'redraw' );

http://multi-level-push-menu.make.rs/#methods

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants