Share Posted July 27, 2019 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 Link to comment Share on other sites More sharing options...
Share Posted July 28, 2019 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. 2 Link to comment Share on other sites More sharing options...
Author Share Posted July 28, 2019 Hi @PointC, I simplified the pen and thanks for help. Jiri Link to comment Share on other sites More sharing options...
Share Posted July 28, 2019 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 3 Link to comment Share on other sites More sharing options...
Author Share Posted July 30, 2019 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 Link to comment Share on other sites More sharing options...
Share Posted July 30, 2019 No, clip-path is not a feature that all browsers support (that has nothing to do with GSAP): https://caniuse.com/#feat=css-clip-path 3 Link to comment Share on other sites More sharing options...
Share Posted July 30, 2019 Hey @Jiri, If you like a lookalike - a fake of a clipPath ... See the Pen LwyVdY by mikeK (@mikeK) on CodePen Happy forking ... Mikel 4 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now