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?