I have simple form with ajax and I need when all thing with forms is done like in req.done JavaScript will wait for CSS3 animation and show #vyhra after CSS3 animation ended.
I tried it in the bottom in code but it not working.
(function($) {
var form = $('#email-form');
form.on('submit', function(event) {
event.preventDefault();
var req = $.ajax({
url: form.attr('action'),
type: 'POST',
data: form.serialize()
});
req.done(function(data) {
console.log( data );
$('.koleso').toggleClass('koleso-active');
form.hide();
if($('.koleso-active').addEventListener("animationend", listener, false)) {
$('#vyhra').show();
}
});
});
}(jQuery));
setIntervalevent with the same (or maybe right after) amount of time from the animation ?