Open abombelli opened 7 years ago
Hi,
Overall menu height, if not set in options to some fixed value, will be set equal to the tallest menu height.
For example try commenting out menuHeight
in custom size demo shown at http://multi-level-push-menu.make.rs/demo/customsize/customsize.html. Once you've done that height of the menu will be equal to height of the tallest (sub)menu (e.g. Magazines).
Regards
Hi @adgsm, Is there anyway to set height to the current submenu? or at least find out height of current (sub)menu? I don't want to limit the height or introduce scrollbar, I just want the page to adapt to current longest content.
Thanks
$("[data-level=1]").height();
thanks for getting back. I tried this but it seems to return the same height whatever submenu I click into?
You have to choose right selector ($("[data-level=1]")
) for targeted submenu. $("[data-level=1]")
was just an example for 1st sub menu after root.
For example
$( '#menu' ).multilevelpushmenu({
onItemClick: function() {
// Second argument is menu level object containing clicked item (<div> element)
$menuLevelHolder = arguments[1];
$menuLevelHolder.height();
}
});
will return height of the (sub)menu containing clicked item.
both using $menuLevelHolder = arguments[1]; $menuLevelHolder.height(); in onItemClick and onGroupClick, gives the same number as any data-level, for some reason the height is all set to max. The proper height of each submenu seems to be the ul tag inside each div.levelHolderClass I'm confused.. sorry
Each menu is contained within div element. Div element contains ul which then contains li elements... using same jquery method you can mesaure height of any of these elements, or maybe top offset if you like...
pon, 14. maj 2018. 02:13 Waleed Al-saady notifications@github.com je napisao/la:
both using $menuLevelHolder = arguments[1]; $menuLevelHolder.height(); in onItemClick and onGroupClick, gives the same number as any data-level, for some reason the height is all set to max. The proper height of each submenu seems to be the ul tag inside each div.levelHolderClass I'm confused.. sorry
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adgsm/multi-level-push-menu/issues/167#issuecomment-388666383, or mute the thread https://github.com/notifications/unsubscribe-auth/AFhKYyhwCeqhxcTqd69nE0wpJOvFS3Keks5tyMw2gaJpZM4LtOQL .
Hi
Is there a way to set an automatic height of the menu? Let's say a sub-menu has more items then the parent, then the container adapts to his height.
Thanks!