, , (, ) , , , .
var queue = new Array();
$("#img1").on("hover", function() {
var delay = 500;
$("#mainContainer").children('div').each(function(i) {
var _this = this;
queue.push(setTimeout(function() {
animate(_this);
}, i * delay));
});
});
function animate(elem) {
$(elem).css("transition", "500ms all ease-in-out");
$(elem).css("transform", "perspective(100px) rotate3d(1, 1, 0, 360deg)")
$(elem).css("background-color", "#fff");
}
function clearQueue() {
for (index in queue) {
clearTimeout(queue[index]);
}
}
$("#mainContainer").on("mouseleave", function() {
clearQueue();
$("#mainContainer").children('div').each(function(i) {
$(this).css("transition", "0ms all ease-in-out");
$(this).removeAttr('style');
});
});
Fiddle.