ArekSz Posted April 16, 2020 Share Posted April 16, 2020 Hi, i'm not sure what i'm doing wrong, but based on this topic i'm trying to mix horizontal and vertical scrolling + adding anchors links. But for some reason when i click on any #URL it scrolls but distance is calculated wrong What am I missing here? See the Pen RwWrzZb by arek_szczerba (@arek_szczerba) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted April 16, 2020 Share Posted April 16, 2020 Hey ArekSz and welcome to the GreenSock forums! First off, ScrollMagic isn't a GreenSock product and we don't really recommend it. You can create the same effect without it. In fact, GreenSock is in the process of making a scroll plugin for GSAP that will be able to handle things like this more easily! But you have two issues: Your calculation of the distance is off (you shouldn't subtract out the viewport's width / 2) and you didn't change the ease of the tween for your scroll tween to none. Fixing those issues fixes the effect: See the Pen jObqNLO?editors=0010 by GreenSock (@GreenSock) on CodePen We highly recommend using GSAP 3 because it has a smaller file size, sleeker API, and a bunch of new features! 4 Link to comment Share on other sites More sharing options...
ArekSz Posted April 17, 2020 Author Share Posted April 17, 2020 Thank you for ZachSaucier your answer, it's great and works well Wish to change to GASP 3 but not sure i will be able to rewrite it, but will try 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