Skip to content

Commit

Permalink
perf(animit): Changed to use requestAnimationFrame() on Animit.queue(…
Browse files Browse the repository at this point in the history
…) method.
  • Loading branch information
anatoo committed Oct 9, 2015
1 parent 39816ae commit b9c7025
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/lib/animit.js
Expand Up @@ -371,9 +371,11 @@ window.animit = (function(){
});

if (elements.length > 0) {
util.forceLayoutAtOnce(elements, callback);
util.forceLayoutAtOnce(elements, function() {
util.batchAnimationFrame(callback);
});
} else {
util.batchImmediate(callback);
util.batchAnimationFrame(callback);
}
};
}
Expand Down Expand Up @@ -517,7 +519,7 @@ window.animit = (function(){
// force layout
element.offsetHeight;
});
util.batchImmediate(callback);
callback();
});
},

Expand Down

0 comments on commit b9c7025

Please sign in to comment.