adgsm / multi-level-push-menu

MultiLevelPushMenu jQuery Plugin implementation
http://multi-level-push-menu.dzunic.net
804 stars 213 forks source link

Resize menu width automatically #190

Open mattiteve opened 4 years ago

mattiteve commented 4 years ago

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 commented 4 years ago

Maybe

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

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