rstacruz/jquery.transit — pull request #102 by bitgangsta (2013-01-11 05:57:07+00:00)
Title: Adding keyframe animation support

Hi,

I have added support to your plugin for controlling "keyframe" animations. I'd like to get your feedback before continuing to go any further.

Right now this supports the following:

1. Applying a "keyframe" animation by name to an element.
```javascript
$("#foo").playKeyframe({name: 'bounce-in', duration: 1000});
```
2. Pause/play/reset
```javascript
$("#foo").pauseKeyframe().resumeKeyframe().resetKeyframe();
```
3. Callbacks
```javascript
$("#foo").playKeyframe({name: 'bounce-in', duration: 1000}, function() { ... });
```

I supported your "alternate" style of passing callbacks in as well, as a coffee-script user it makes things much easier to have it in the hash like that. I also tried to follow your code conventions as much as possible. The one exception is that I did not implement a "splat" style method signature. This is because there are a large number of arguments to the keyframe animation call, and it seems unreasonable for the user to have to think about the order or set them in order if they just want to customize a few. I am open to implementing the "splat stype" though, if you think it should be there.

I have yet to do two things:

1. Adding keyframe support. I am not so sure this is 100% necessary off the bat. I think if you're going to build your own animations in JS, why not just chain together transitions and use your existing lib functionality. jQuery nicely handles this via the fx queue. The one downside I can see, however, is that when using keyframe animations, you can get some greater control over easing the entire set of states. With your library, I can control easing for each step, but not a group of steps.
2. Tests. I will definitely add these if you're interested in this pull request. I assume you'd like them before you accept it.

Note this is sortof related to your issue #3, which mentioned keyframe support.