SaifUllah Posted February 8, 2023 Share Posted February 8, 2023 Hi Guys, I'm trying to create sections navigation on Horizontal Scroll, but my offsetLeft isn't calculating fine. could please have a look and let me know the issue, seems like this issue is because of ScrollTrigger end value/option but I really need this option and same value to make my Animations slower and smoother. What could be the possible solution to get 100% accurate offsetLeft without removing the ScrollTrigger end value? Thanks. See the Pen zYLQeLZ by saifullahbutt85 (@saifullahbutt85) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted February 9, 2023 Share Posted February 9, 2023 You're doing some highly customized things with the "fake pinning" horizontally which offsets things of course, thus you have to factor all that in to your scroll positions that you're correlating to your anchor links. It's beyond the scope of help we can provide for free in these forums, but if you're interested in paid consulting services, feel free to reach out to us and we can help you with this. In the meantime, this helper function may help, but it's not going to factor in your custom horizontal offsets (I'm only mentioning it here in case it helps as a starting point for you): https://greensock.com/docs/v3/HelperFunctions#getScrollLookup Here are some other CodePens showing various approaches to linking in ways that factor in ScrollTrigger pinning (but again, none of them handle the custom horizontal offsets that fake pinning): See the Pen wvrXRdZ by GreenSock (@GreenSock) on CodePen See the Pen poKEEKB?editors=0010 by GreenSock (@GreenSock) on CodePen See the Pen xxjErmp?editors=1010 by GreenSock (@GreenSock) on CodePen See the Pen NWYxBKO?editors=0010 by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
karzol73 Posted June 17, 2023 Share Posted June 17, 2023 Hi SaifUllah! In the meantime, did you find a solution for this scrollTo issue? If so, I would be more than happy if you could share with me. Thanks! Link to comment Share on other sites More sharing options...
Rodrigo Posted June 19, 2023 Share Posted June 19, 2023 Hi @karzol73, If you share a minimal demo that clearly illustrates the issue you're having we could definitely nudge you in the right direction about solving it. Happy Tweening! Link to comment Share on other sites More sharing options...
SaifUllah Posted June 19, 2023 Author Share Posted June 19, 2023 Hi @karzol73 No I've not found any solution yet, the issue is still there and didn't get resolved yet. 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