motion-ui icon indicating copy to clipboard operation
motion-ui copied to clipboard

JavaScript API Changes

Open gakimball opened this issue 10 years ago • 0 comments

Here are some things we want to add or change to the JavaScript API.

animateIn and animateOut would be renamed transitionIn and transitionOut, to make it less confusing that a function called "animate" only works with transitions.

Right now there's no method to add animations, because all you need to do is add a class. But we could write a wrapper that also handles removing the class for you, and giving you a callback that fires when the animation completes (if it has a finite number of loops).

It might look like this:

MotionUI.animate('#element', 'wiggle', function() {
  // Animation done
});

gakimball avatar Oct 19 '15 19:10 gakimball