Jump to content


Weird Problem - GSAP ScrollTo Only Works After Window Rezising

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I'm at a loss here folks. lol


Basically, if you check out the Codepen, and try to scroll up or down no scrolling occurs...

If you manually resize the window then the scrolling magic happens.


Has anyone encountered anything like this before?





See the Pen AbBNmA by kreendurron (@kreendurron) on CodePen

Link to comment
Share on other sites

Tough to diagnose because the file is marked "read only", so we can't really tweak things effectively but did you try doing a console.log() of your "delta" variable to make sure it's what you expect? 


Also, are you seeing this problem outside of codepen? I wonder if it's an issue with their new "projects" feature [preview]. 

Link to comment
Share on other sites

I'm thinking it may have to do with a conflict with the yay.min.js sidebar... not sure yet.


I'm getting exact same results in Brackets.io editor...


I just uploaded to a codepen project to show what I'm seeing.


This was the codepen that i've been trying to implement into my site:

See the Pen kDvmC by bassta (@bassta) on CodePen

Link to comment
Share on other sites

but even removing the yay sidbar script and css file out still has same effect in my full project, so i dont know..

Link to comment
Share on other sites

Can you provide a reduced test case [regular] codepen that's editable? That'd sure help with troubleshooting. 

  • Like 2
Link to comment
Share on other sites

Okay.. I take it back.

It's not just codepen...


Removing <!DOCTYPE html>

from the index... allows the page to scroll without resizing... 



I've uploaded it to my test server... if I were to remove the <!DOCTYPE html> the scrolling would work just fine... obviously I can't just publish the page without the doctype...

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.