I have this sequence of timelines chained to a master using .add(). I need to clear the properties of the first timeline called background , more specifically the xPercent which is bugging on browser resize.
I tried adding it to the tweenFromTo at the end as tweenFromTo(background.duration(), 0, { clearProps: true), but it did not work.
const background = gsap
.timeline({ paused: true })
.to(".lytbox-menu__nav", {
xPercent: 100,
})
.to(pseudo, {
cssRule: {
scaleX: 0.4,
transformOrigin: "right",
},
});
master
.add(background.tweenTo(background.duration()))
.add(tl2)
.addPause();
menuOpened = master.duration();
master
.add(tl3)
.add(
background.tweenFromTo(background.duration(), 0)
);