I was trying to create a function that was the inverse of TimelineLite.set(), as from() is the inverse of to(). So a set() function that starts the property at the passed value, then swaps back to the initial value. I wrapped TimelineLite from() to achieve this with a time of zero:
function unset(selector, props, position) {
// Does not work.
new TimelineLite().from(selector, 0, props, position);
};
TimelineLite.from() does not work if time is less than 0.0000003.
So remedied this with:
function unset(selector, props, position) {
// Does not work if duration < 0.0000003.
new TimelineMax().from(selector, 0.0000003, props, position);
};
Is 0.0000003 some sort of magic number? Is this expected behavior? Is there a function that already does what I want?
I was testing in Chrome on OSX.