Jump to content
Search Community

ScrollTrigger snap to section with normal functional scroll bar (without triggering sections)

Wizard of Oz test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

Hi, this is my very first post and I am very happy to be here :)

 

I am learning from this codepen and had 2 questions

1. Is there a way to make the scrollbar work normally? On the pen I am learning from, it looks like scrolling down the site with the scrollbar, either by pressing and holding or clicking it results in some unusual activity. I saw the Tesla site also uses snap to sections technique but its possible on their site to use the browser scrollbar as normal. Here is the link to the tesla site: https://www.tesla.com/no_no/solarroof

 

2. How would one go about adding navigation like the attached screenshot? 

TIA

Screenshot-(9).jpg

See the Pen NWxNEwY by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

  • Solution

Hi and welcome to the GreenSock forums.

 

It seems to me that the Tesla site is not using the same approach of the codepen. Basically the site checks different events (mouse wheel, keyboard, etc) and scrolls the entire viewport to a specific section of the page. Also if you move scroll down mid-section using the scroll bar and then use an event, it also behaves a bit weird.

 

Honestly, if I was using that approach I'd remove the scroll bar and follow the code used in this samples by @PointC:

See the Pen MzWzyv by PointC (@PointC) on CodePen

See the Pen YRzRyM by PointC (@PointC) on CodePen

 

Happy Tweening!!!

  • Like 3
Link to comment
Share on other sites

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...