Hey, Could do with a little help please, I'm new to GSAP (and Javascript in general), I've got a pretty basic grasp of GSAP and I've put together an overlay menu based on this copepen: https://codepen.io/tkruca/pen/qBNGOLm. I haven't had chance to make my own, but it mimics this on the most part. With this method the overlay allows body scroll when active, I would like to stop that.
I've trawled lots of other pens/forum posts and found various methods to try but it's just left me more confused. Can someone please advise how to achieve the body lock and whether this method is actually a good way to do an overlay menu, or is there a more simple method to achieve the same thing. I've had a few ideas:
I've seen there's the classList API amongst (other methods but they arent GSAP methods) but I'm not 100% sure how that fits into this build, would I add it to the navBtn so it adds removes a class from the body on toggle? Or, would I '.set' the timeline to add a class to the body? With the timeline being reversed on click can I '.set' the body at the end of the timeline, so when it's closed the body: fixed class is removed?
I've tried reading the docs on the site but I'm ADHD, so I struggle with large pages of info etc, I end up going down rabbit holes and getting lost.
Any help would be really appreciated.
Thanks Mat