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

Automatic height #167

Open
abombelli opened this issue Jan 25, 2017 · 8 comments
Open

Automatic height #167

abombelli opened this issue Jan 25, 2017 · 8 comments

Comments

@abombelli
Copy link

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!

@adgsm
Copy link
Owner

adgsm commented Jan 25, 2017

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

@wal88
Copy link

wal88 commented May 10, 2018

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

@adgsm
Copy link
Owner

adgsm commented May 10, 2018

$("[data-level=1]").height();

@wal88
Copy link

wal88 commented May 11, 2018

thanks for getting back. I tried this but it seems to return the same height whatever submenu I click into?

@adgsm
Copy link
Owner

adgsm commented May 11, 2018

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.

@adgsm
Copy link
Owner

adgsm commented May 11, 2018

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.

@wal88
Copy link

wal88 commented May 14, 2018

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

@adgsm
Copy link
Owner

adgsm commented May 14, 2018 via email

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

3 participants