Closed rileyjshaw closed 9 years ago
This is a bad idea. I just implemented it and it's awkward.
Better idea:
// starts the animation
var obj = sweep(document.querySelector('p'), 'color', 'red', 'blue');
// stops the animation
obj.pause();
// resumes the animation
obj.resume();
Calling
sweep(...)
should return a reference to the animation object that can be cancelled at any time. We probably don't want the object to be directly editable.If we're just dealing with the animation object itself, adding
is trivial: just push it back onto the
batch
array.