Answer the question
In order to leave comments, you need to log in
How to make animation correctly?
Ajax loads new content, if the array object has the new property, I give it the appropriate class:
<div class="list card" ng-class="{new: feed.new == true}">
angular.module('tb.animation.feed', [])
.animation('.new', function(){
return {
addClass: function(element, className){
console.log('add class')
},
removeClass: function(element, className){
console.log('remove class')
}
}
});
angular.module('tb.animation.feed', [])
.animation('.new', [function() {
return {
// make note that other events (like addClass/removeClass)
// have different function input parameters
enter: function(element, doneFn) {
console.log('enter')
//jQuery(element).fadeIn(1000, doneFn);
// remember to call doneFn so that angular
// knows that the animation has concluded
},
move: function(element, doneFn) {
console.log('move')
//jQuery(element).fadeIn(1000, doneFn);
},
leave: function(element, doneFn) {
console.log('leave')
//jQuery(element).fadeOut(1000, doneFn);
}
}
}]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question