rstacruz / jquery.transit

Super-smooth CSS3 transformations and transitions for jQuery
http://ricostacruz.com/jquery.transit
7.29k stars 864 forks source link

Feature request: animation transform to css class #122

Closed zh99998 closed 11 years ago

zh99998 commented 11 years ago

transit works perfectlly in small projects, but if UI is more complex, it's better to define styles in css and transform to a class...

rstacruz commented 11 years ago

This can already be accomplished:

$("#logo").transition({ opacity: 1 }, function() {
  $(this).addClass('done');
});
igor10k commented 11 years ago

@rstacruz your code is just adding class "done" after the transition is finished, but I think that @zh99998 is actually speaking of using the class' css for transition. Something like:

$(this).css("transition", "all 0.5s");
$(this).addClass("newState");

like jQuery UI allows addClass with duration http://api.jqueryui.com/addClass/

windyjl commented 11 years ago

i prefer creating a CSS class by transit, and add this class to any jQuery Object. but now we should create a function to do that. @keyframes xxx{} & function(){ $box.transit} Excuse my poor English.