Jump to content
Search Community

scrollTop in Greensock?

Vincentccw test
Moderator Tag

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 have created a sample for it:

See the Pen vLIGh by vincentccw (@vincentccw) on CodePen

 

If you look into my javascript panel I have 2set of codes, one using jquery and GSAP another is just jquery(comment out). The code will be active once use scroll down using mouse wheel.

 

My question is how do I use scrollTop but completely in GSAP? As I think GSAP is more readable and animate faster and most importantly I can set up more complex animation at the same time.

Link to comment
Share on other sites

Hi,

 

The engine has it's own plugin, the scrollTo plugin, is incredibly simple to use, you get great results and you could animate other things while the scroll takes place.

 

You can read more about it here:

http://api.greensock.com/js/com/greensock/plugins/ScrollToPlugin.html

 

I've created some samples as well as a blog post in this matter:

 

http://codeaway.info/greensock-animation-platform-scroll-to-plugin-sample/

 

In the following codepens the scrollTo plugin is used to generate an autoscroll feature that it could help, considering the structure of the codepen you just posted:

 

Fixed height sample: 

See the Pen bjLxe by rhernando (@rhernando) on CodePen

 

Dynamic height sample: 

See the Pen dLxAJ by rhernando (@rhernando) on CodePen

 

Hope this helps,

Cheers,

Rodrigo.

  • Like 4
Link to comment
Share on other sites

Hi,

 

The engine has it's own plugin, the scrollTo plugin, is incredibly simple to use, you get great results and you could animate other things while the scroll takes place.

 

You can read more about it here:

http://api.greensock.com/js/com/greensock/plugins/ScrollToPlugin.html

 

I've created some samples as well as a blog post in this matter:

 

http://codeaway.info/greensock-animation-platform-scroll-to-plugin-sample/

 

In the following codepens the scrollTo plugin is used to generate an autoscroll feature that it could help, considering the structure of the codepen you just posted:

 

Fixed height sample: 

See the Pen bjLxe by rhernando (@rhernando) on CodePen

 

Dynamic height sample: 

See the Pen dLxAJ by rhernando (@rhernando) on CodePen

 

Hope this helps,

Cheers,

Rodrigo.

 

Thanks but 1 of your link appear to be broken, nevertheless everything is well documented in the documentation so is fine though I can refer from there.  :-P

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