Jump to content
Search Community

(scrollTrigger) update animated value on onRefresh

plastois test
Moderator Tag

Go to solution Solved by ZachSaucier,

Recommended Posts

Hello!

 

I searched docs and forums but i can't find answer for my problem. I have ScrollTrigger animation, where xPercent is a variable. I want change it on refresh, like this:

gsap.to(".class", {
				scrollTrigger: {
					trigger: parent_trigger,
					pin: true,
					start: "top top",
					markers: true,
					scrub: 1,
					invalidateOnRefresh: true,
					snap: {
						snapTo: 1 / 200,
						duration: {min: 0.2, max: 0.3},
						delay: 0
					},
					onRefresh: () => {
						let scroll_width = 100 - ($(window).width()*100 / width);
						xPercent: -scroll_width
					},
				},
				xPercent: -scroll_width,
				ease: "none",
			});

Is there any way to archive my goal?

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