I have a bug in my jQuery/
animate.css
$('#tiles').addClass(tiles_in).one(animation_end, function() {
// called twice
log('tiles in');
});
change_tiles
tiles out
tiles in
div
tile out // normal
tiles in // why ?
Tiles in
one()
.replaceWith()
I have found it myself after logging the event that was fired.
https://jsfiddle.net/uhz6Ly0s/8/
$('#tiles').addClass(tiles_in).one(animation_end, function(event) {
log('tiles in, event=' + event.type);
});
The first event is animationend
, and the second is webkitAnimationEnd
. For some reasons, the second one is fired at the end of the click event.