Jump to content
Search Community

Collapsing menu navigation

Roman Kovalev test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hey, there! 
I'm woking on collapsing menu elements with GreenSock. The idea is to create elements to appear on desktop as it is, but in mobile version it goes like accordion. And I have experienced some kind an issue.

I need GreenSock to work in mobile only and when I'm back to desktop - greensock stops its functionality. So far I' m using flags  to understand if the version is mobile and clear tweens via clearProps:"all" (dont think its the best approach).  And the issue is: when I'm switching between mobile and desktop versions some time (often) menus are not collapsing, or collapsing with the wrong height size, or with wrong appearance of menu elements. I've made codepen example. Can you, guys, point me whats wrong? 

See the Pen jLEPEJ by NeedHate (@NeedHate) on CodePen

Link to comment
Share on other sites

Sorry, I don't understand what your demo is supposed to do. I didn't see any animation and clicking on words only took me to other websites. I tested on both desktop and my phone. If I'm viewing it on my phone how am I supposed to switch to the desktop version and know what isn't working?


Please provide some more details so we have a better idea of what we should be seeing and what issue needs to be fixed. Thanks.

Link to comment
Share on other sites

My appologies for not asking right. Set the width of a pen to 600px, it goes to a mobile version. Then click on headings. They have to open the list of submenu links animating height and submenu elements appearance. When you go back to a "desktop" version (upper then 600px) the block becomes as a simple grid. Then back to "mobile". And animation crushes: not setting right height or submenu elements dont appear from left to right.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...