Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Oleksandr07

ScrollTrigger refresh afrer resizing page

Recommended Posts

After resizing the page, the value passed to .to is not updated and the image is shifted further than required

See the Pen BawaWZN by Oleksandr07 (@Oleksandr07) on CodePen

Link to comment
Share on other sites

Hey there,

 

you'll want to use functional values alongside the invalidateOnRefresh to make sure ST does get the new value for the window's width on refresh.

 

// change this
x: -$( window ).innerWidth()

// to this

x: () => -$( window ).innerWidth()

 

See the Pen oNGRrYj by akapowl (@akapowl) on CodePen

 

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