Jump to content
GreenSock

Roman Kovalev

Smooth scroll issue

Go to solution Solved by Diaco,

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

Guys, I'm using some specific technique to build something like that is in codepen pattern.
But the thing is that its not working, when the height of body is max 100vh. Is there any way to avoid this issue using this awesome script?

See the Pen ogrvrv by NeedHate (@NeedHate) on CodePen

Link to comment
Share on other sites

It's not scrolling because you have the body set to height: 100vh. You usually set an element to 100vh, like a slide, not the body. If you need to do a full bleed, you could do something like setting the body to min-height: 100vh

 

See the Pen PwrwYe by osublake (@osublake) on CodePen

  • Like 2
Link to comment
Share on other sites

Yes, I understand that body has 100vh. Thats the trick, so the left side of menu always have 100% of window heighе . But why doesn't scroll work in othert scrollable elements? On the element of the ".content" class, for example? is it possible to change something, so the scroll is to work in a specific container?

Link to comment
Share on other sites

Perfect! What has been changed? Not strong in JS, but always trying to understand what is happening.

Link to comment
Share on other sites

The overflow scrolling is happening in the .content instead of the window, so that's where you would get your scrollTop value. The scrollTop value is kind of like the y value for the .wrapper.

  • Like 2
Link to comment
Share on other sites

Aha, ok, i get it. Thank you, guys! I will hang around, if you dont mind! *)

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