Jump to content
Search Community

horizotal panel scrolling with nav buttons

BHAVY J
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

Posted

The panels can be scrolled manually or with button so when i scroll manually i update currentIndex(variable) so it sync properly with navigation button but now issue is when i navigate with button the scrolltrigger instance is not updated so when i navigate to panel-2 from panel-1 and  try to scroll down it doesnt move.

See the Pen GRbjbRd by bhavy123 (@bhavy123) on CodePen.

  • Solution
Posted

Hi @BHAVY J welcome to the forum!

 

Instead of animating the sections you're already animating with ScrollTrigger you want to update the scroll position of the page to reflect the point you want to scroll to. I've write a whole post about ways going about this. It involves the ScrollToPlugin and especially check the second comment it has some really nice helper functions! Hope it helps and happy tweening! 

 

 

  • Like 3
Posted

Thanks @mvaneijgen for replay.

This was really helpful. now I got the clear understanding.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...