Jump to content
Search Community

Move elements by up/down scrolling.

Kees 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

hmm, I'm having difficulty understanding the question. Not sure what effect you are trying to achieve.

Perhaps you can elaborate on what you need to do. I don't really notice much animation on that page other than some rollovers.

  • Like 1
Link to comment
Share on other sites

Hello Kees, and Welcome to the GreenSock Forum!

 

Here is a quick solution in detecting if scrolling up or down using jQuery, could also be done in native javascript:

 

See the Pen KwBgoK by jonathan (@jonathan) on CodePen

:

var prevScroll = 0;
    
$(window).on("scroll", function () {
       var $this = $(this),
           $statusText = $("p > span"),
           currScroll = $this.scrollTop();
 
       if (currScroll > prevScroll){
          // scrolling up
       } else {
          // scrolling down
       }
       prevScroll = currScroll;
});

:

Hope this helps! :)

  • Like 1
Link to comment
Share on other sites

Hi Kees,

 

In order to add to the great advice by Jonathan, the images' animations in the sample link provided are a very common type of parallax effect. Some time ago Chrysto made a great example using GSAP, perhaps could be enough to get you started:

 

See the Pen aEkwL?editors=001 by bassta (@bassta) on CodePen

 

If you need more help feel free to keep asking.

 

Happy Tweening!!

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