Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Jiri

Responsive GSAP Menu Reveal

Recommended Posts

Hi everybody,

I try to make tween menu responsive but got lost. ūüė≠

I use watchmedia and addListener to change width of menu panel but my script obviously does not work properly when a) resizing the window b) resizing window and clicking menu button.

Is there a good soul that could help me to fix it? Your ideas are welcome.

Thanks a lot.

Jiri

 

See the Pen Jgbvde by jordanboza (@jordanboza) on CodePen

Share this post


Link to post
Share on other sites

Hi @Jiri,

 

I see your post has a lot of views but no answers yet. That's probably because you have so much going on in the demo. Simplified demos make it much easier to troubleshoot. Getting into media queries and responsive layouts is a bit beyond the support we offer around here. We do try to keep the focus on GSAP support.

 

That being said, I think this thread can help.

You'll see that thread has a lot of good info and links to other responsive threads. I'd pay particular attention to @OSUblake's demo in that thread with the blue and red squares. It's a nice and simple example to get you started. It's always best to start small and build up.

 

Hopefully that points you in the right direction.

 

Happy tweening.

:)

 

  • Like 2

Share this post


Link to post
Share on other sites

Hi @PointC,

I simplified the pen and thanks for help.

Jiri

Share this post


Link to post
Share on other sites

hey @Jiri,

 

Thanks for the reduce case.


In addition to the perfect recommendations of @PointC here is the hint that you can excellently animate a clipPath using GreenSock.

 

Together with a matchMediaList it could look like this:

 

See the Pen NQWdEP by mikeK (@mikeK) on CodePen

 

Happy tweening ...

Mikel

 

 

  • Like 3

Share this post


Link to post
Share on other sites

Hello @mikel,

 

thanks for your good hint and your pen.

I just have one more question. Will that GSAP animated clipPath be played in all main browsers?

Thanks for advise.

 

Jiri

Screen.png

Share this post


Link to post
Share on other sites

Hey @Jiri,

 

If you like a lookalike - a fake of a clipPath ...

 

See the Pen LwyVdY by mikeK (@mikeK) on CodePen

 

Happy forking ...

Mikel

 

 

  • Like 4

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

√ó