Jump to content
Search Community

Using scrollTo to move page correctly

scriptmunkee test
Moderator Tag

Recommended Posts

Hi,

In the simple attached code pen what im trying to achieve is:

  • pin the header so the section element moves up as opposed to the page go down
  • have the section fade in from a 0 opacity to full opacity
  • have the functionality to finish the scroll if a user only half completes it

 

Where do i do this?

T.I.A. Chris

See the Pen VweXGYZ by scriptmunkee (@scriptmunkee) on CodePen

Link to comment
Share on other sites

Hey Chris. 

1 hour ago, scriptmunkee said:

pin the header so the section element moves up as opposed to the page go down

I don't understand what you mean here. Can you please link to a page that has this effect or show a diagram of what you mean?

 

1 hour ago, scriptmunkee said:

have the functionality to finish the scroll if a user only half completes it

I assume you mean that the scroll position snaps to an end state?

 

It sounds like you want to use ScrollTrigger along with its pinning and snapping:

 

  • Like 1
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...