Jump to content
Search Community

Updating values on window resize

David1985 test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi everyone,

 

I came across a horizontal scroll solution made by GSAP's Cassie that features a pausing effect on each horizontal scroll item. On initial page load this works perfectly! However when the window is resized, the effect is broken. If you look at the Codepen, there are two values that need be updated. container.offsetWidth, and the variable increment. From my understanding having 'invalidateOnRefresh: true' should update the container value, but it doesn't seem to be. The increment variable uses the container value as well so it is also not updating.

 

Is anyone able to take a look and see what it would take to make it responsive? Hopefully it is a relatively easy fix.

 

Thank you

See the Pen NWeBwBL by dfranz1 (@dfranz1) on CodePen

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