Hello,
I have a fromTo tween. like this:
gsap.fromTo(
slide, {
x: 20,
opacity: 0
}, {
x: 0,
opacity: 1,
duration: .2,
}
);
In this case the x value of the from is 20.
But another time the x value is 0, so i only want to animate the opacity.
That is going well, but the only thing is. The x property is also set, when its 0.
The question is: How can i use the same tween but with other values.
Do i need to make an object with the, from values and, to values?
I can write an if else statement but i think there is a quicker and cleaner way.
I would like to hear what the best solution for this is.
Thanks in advance!