Jump to content
Search Community

animation start after whole section is scrolled in viewport

asdg-ag

Recommended Posts

Posted

hi, 

is gsap has option that animation start after whole section(1vh) is scrolled in viewport?

 

I want to start few different animations in array but, start is when whole section comes in view.

 

Thanks in advance.

Posted

Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

 

Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

 

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen.

that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

 

Using a framework/library like React, Vue, Next, etc.? 

CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import GSAP as shown in the Install Helper in our Learning Center : 

 

Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

Posted

Hey @GSAP Helper,

 

i want to make something like that, i asked here is it possible with gsap.

 

for example:

 

scrolling section1(1vh), only after whole section is scrolled in view (its automated with fullpage.js), text is starting animation after 1 sec.

Posted

Hi,

 

I think we're having some problems trying to understand exactly what you're trying to achieve. I've read both of your posts in this thread and I still can't understand exactly what you're looking for. If is something similar to what can be achieved with FullPage.js, then perhaps you should have a look at the Observer Plugin:

https://gsap.com/docs/v3/Plugins/Observer/

 

Finally I don't know if there is some animation for the web that can't be done with GSAP, I've been using this tool for 14 years and I've seen pretty much everything, from a simple hover animation on a button to complex SVG/WebGL sites and apps that will drop your jaw, but if you are not clear in terms of what you're after there is not a lot we can do to point you in the right direction. If you can find a URL that shows something similar to what you have in mind that would be a solid first step.

 

Happy Tweening!

Posted

 

Have you seen the Observer plugin https://gsap.com/docs/v3/Plugins/Observer/

See the Pen XWzRraJ by GreenSock (@GreenSock) on CodePen.


I've also wrote a guide how you can step through a timeline using the Observer plugin 

 

Hope it helps and happy tweening! 

 

 

 

  • 4 months later...
Posted

hi guys, thanks for help, i will try to explain what i want:

 

its like intersection observer, animation start after top of the section reach top of the screen.

 

you are scrolling,

section2 appearing,

section2 reach top of the screen,

only then does the animation in section 2 begin, and its not depend on scroll anymore, just on the timeframe, 2sec, 3sec or something else.

 

it sounds easy but somehow i don't know how to do it with gsap.

 

thanks.

 

GSAP Helper
Posted

What have you tried already? We love to see what you can come up with, that way we can see your thought process and thus better help you understand the tools!

 

If you're new to GSAP check out this awesome getting started guide https://gsap.com/resources/get-started/

 

Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

 

Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

 

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen.

that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

 

Using a framework/library like React, Vue, Next, etc.? 

CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import GSAP as shown in the Install Helper in our Learning Center : 

 

Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

Posted

Hi,

 

What you can use of those demos with ScrollTrigger and Observer is to use the onEnter callback from GSAP to enable the Observer instance that will prevent the scrolling and start a Tween/Timeline. Then use the onComplete callback from the Tween/Timeline to disable the Observer instance and allow scrolling again.

 

Something like this demo but without the onUp and onDown callbacks in the Observer instance:

See the Pen WNqVaVx by GreenSock (@GreenSock) on CodePen.

 

Finally is worth mentioning that what you're trying to achieve is not something that can be done natively. One of the few way browsers can do that is through overflow, so you should keep in mind that this way of achieving that with Observer is the best possible approach to do this and might not always be 100% effective in every particular scenario.

 

Hopefully this helps

Happy Tweening!

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