Jump to content
Search Community

ScrollTrigger problems

Andy777 test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

Hi,

 

Are you talking about something like this?:

gsap.to(".about", {
  y: -50,
  opacity: 1,
  duration: 1,
  repeat: 2,
  yoyo: true,
  scrollTrigger: {
    trigger: ".about",
    start: "top center",
    end: "bottom center",
    toggleActions: "play none none reverse",
    markers: true
  }
});

If not, please be more specific as to what you intend to do in order to find the best possible approach for it.

 

Happy Tweening!

Link to comment
Share on other sites

  • Solution

Hi,

 

You mean this:

gsap.to(".about", {
  y: -50,
  opacity: 1,
  duration: 1,
  scrollTrigger: {
    trigger: ".about",
    start: "top center",
    end: "bottom center",
    toggleActions: "play reverse play reverse",
    markers: true
  }
});

No need to apologize for the language barriers ;)

 

Happy Tweening!

Link to comment
Share on other sites

Hi,

 

You can check the docs to find out more about Scroll Trigger:

https://greensock.com/docs/v3/Plugins/ScrollTrigger

 

From the ScrollTrigger docs:

  • onEnter: When the scroll position moves forward past the "start" (typically when the trigger is scrolled into view).
  • onEnterBack: When the scroll position moves backward past the "end" (typically when the trigger is scrolled back into view).
  • onLeave: When the scroll position moves forward past the "end" (typically when the trigger is scrolled out of view).
  • onLeaveBack: When the scroll position moves backward past the "start" (typically when the trigger is scrolled all the way backward past the start). 

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