Gigi1303 Posted January 23, 2023 Posted January 23, 2023 Hi guys, I'm experimenting with an horizontal scroll section in one of my projects. I used one of the code in the examples given in the Scrolltrigger documentation and modified it a bit. Basically, the horizontal scroll triggers when a section with the class "horizontal" arrives. Everything works great. The problem I'm having is with the mobile version: how could I "destroy" scrolltrigger in smallest screens to stop the horizontal scroll and make the sections go one below the other? I tried with a CSS approach but I don't think it's the right approach. As usual, thanks for your help. See the Pen BaPYJVE by luigi-basile (@luigi-basile) on CodePen.
Solution Cassie Posted January 23, 2023 Solution Posted January 23, 2023 Hi gigi, you can use matchMedia alongside normal CSS media queries, Here you go! See the Pen qByxKNy?editors=0110 by GreenSock (@GreenSock) on CodePen.
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