Steve Lu Posted March 15, 2023 Share Posted March 15, 2023 Animated Continuous Sections with GSAP Observer (codepen.io) In this demo codepen, the lastest section with class "fifth" not showing. Anyone know how to fix it? And the Observer type, is it possible dynamic detect if the device support or not? type: "wheel,touch,pointer", Like desktop change to "wheel" only, and "touch,point" for mobile. See the Pen XWzRraJ by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted March 15, 2023 Solution Share Posted March 15, 2023 Hi @Steve Lu welcome to the forum! Great catch! I've removed the -1 from the wrap variable and that makes it work. Hope it helps and happy tweening! See the Pen JjavXPe?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen @Rodrigo is that something you can edit? 3 Link to comment Share on other sites More sharing options...
Cassie Posted March 15, 2023 Share Posted March 15, 2023 Adjusted it! Quote And the Observer type, is it possible dynamic detect if the device support or not? In terms of this, if the device doesn't support wheel events observer won't throw any errors or anything, this is handled internally, it's like saying 'listen to these if they exist' Link to comment Share on other sites More sharing options...
GreenSock Posted March 16, 2023 Share Posted March 16, 2023 20 hours ago, Steve Lu said: And the Observer type, is it possible dynamic detect if the device support or not? type: "wheel,touch,pointer", Like desktop change to "wheel" only, and "touch,point" for mobile. Yeah, like Cassie said that probably isn't necessary, but just to point it out you can do this if you want: type: Observer.isTouch ? "touch,pointer" : "wheel", 👍 2 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