Я пытаюсь определить, закончилась ли моя анимация css в моем приложении.Как проверить, выполнена ли анимация css в моем случае?
У меня есть что-то вроде следующего
animation.prototype.nextStage = function(){
this.ball.show().addClass('stage' + this.stage); //start the animation
this.ball.on('animationend mozanimationend webkitAnimationEnd oAnimationEnd msanimationend',function(){
//when animation is ended, do something for animation item itself….
})
}
animation.prototype.isEnded = function(){
// now sure how to check if the animation is ended outside of the animation obj.
}
function main(){
this.ball = new animation();
}
main.prototype.checkAnimation = function(){
this.ball.nextStage();
if(this.ball.isEnded){
//do stuff for something that is not part of animation items..
}
}
Я не знаю, как проверить, если мой шар анимация делается в моем главном объекте. Может ли кто-нибудь мне помочь? Большое спасибо!
Пытались ли вы обещание или обратного вызова? –
выполнить анимацию.prototype.isEnded, когда анимация завершена. И, возможно, назовите его чем-то, что имеет смысл. –