- This topic has 4 replies, 2 voices, and was last updated 5 years, 1 month ago by
David.
-
AuthorPosts
-
February 8, 2021 at 6:34 am #1650240
Viktor
Hello,
We have implemented a mega menu as per the official documentation and added a simple one-way css transition because on closing the sub menu a very short view of the sub-menu is visible and transitions rather than the whole panel. Is it possible to have a slide-out effect on the mega menu dropdown?
Also, how to put some animation on the dropdown menus in the off-canvas mobile panel? When we tried this, the menu items disappeared.
Here is the staging site: https://url.tonka.design/-hbh2
Many thanks!
ViktorFebruary 8, 2021 at 8:38 am #1650587David
StaffCustomer SupportHi there,
try this CSS:
#generate-slideout-menu.main-navigation .main-nav ul ul { display: block !important; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-in; height: unset; } #generate-slideout-menu.main-navigation ul ul.toggled-on { max-height: 1000px; }February 8, 2021 at 8:53 am #1650606Viktor
Thanks for the reply David!
This does make the mobile menus slide open, but there is no close slide animation. Also the sub-sub-menus are not accessible. You can see the effect of the code on the website right now.February 8, 2021 at 10:10 am #1650684Viktor
Never mind – my bad. It works but on collapsing the sub-menu disappears immediately, while the height transition is gradual. I applied the transition to the expanding state only and at least no there are no empty spaces during the animation.
#generate-slideout-menu.main-navigation .main-nav .slideout-menu ul { display: block !important; max-height: 0; overflow: hidden; height: unset; } #generate-slideout-menu.main-navigation .slideout-menu ul.toggled-on { max-height: 1000px; transition: max-height 0.3s ease-in; }Ideally, the animation would go in both directions though.
Also, any ideas for the desktop version?February 9, 2021 at 1:47 am #1651342David
StaffCustomer SupportTry this:
#generate-slideout-menu.main-navigation .main-nav .slideout-menu ul { display: block !important; max-height: 0; overflow: hidden; height: unset; transition: max-height 0.3s ease-in-out; opacity: 1; } #generate-slideout-menu.main-navigation .slideout-menu ul.toggled-on { max-height: 1000px; } -
AuthorPosts
- You must be logged in to reply to this topic.