Jump to content
Search Community

ScrollTrigger as a substitute for normal scroll.

ImDIno test
Moderator Tag

Recommended Posts

I need to use scrolltrigger as a substitute for scrolling down a webpage the same way a normal scroll would behave. Please don't ask why.

 

Two problems:

 

1. scroll-to-transform ratio is affected by yPercent and height of the pseudo div, probably even the viewport size.

2. scroll is not linear, towards the end it always takes more scrolling the further you go.

See the Pen GRjORom by dino-paariz (@dino-paariz) on CodePen

Link to comment
Share on other sites

Hey Dino and welcome to the GreenSock forums.

 

Several things you should change:

  • Your trigger should be the tallest content, in this case the #pseudo-div container.
  • Your start and end positions should be changed.
  • Your calculation for how far off the #content section should be corrected.
  • We recommend using the condensed string form for eases.
  • You can drop the label as it's not necessary.

Altogether:

See the Pen PoGOoRQ?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Happy tweening and Merry Christmas!

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