Wait for animation frame

This commit is contained in:
Chuck Dries 2017-06-13 18:56:08 -07:00
parent 7ed9065ee9
commit cfa0a137af

View File

@ -191,15 +191,15 @@
var sp = document.getElementById("scrollprompt"); var sp = document.getElementById("scrollprompt");
document.addEventListener("scroll", function() { document.addEventListener("scroll", function() {
last_known_scroll = getScrollY(); last_known_scroll = getScrollY();
sc(last_known_scroll);
// Usually an important performance consideration, this ends up significantly delaying the resizing of the top box, which is important to stay sized correctly
// if (!queueing) {
// window.requestAnimationFrame(function() {
// sc(last_known_scroll); // sc(last_known_scroll);
// queueing = false; // Usually an important performance consideration, this ends up significantly delaying the resizing of the top box, which is important to stay sized correctly
// }); if (!queueing) {
// } window.requestAnimationFrame(function() {
// queueing = true; sc(last_known_scroll);
queueing = false;
});
}
queueing = true;
}); });
sc(last_known_scroll); sc(last_known_scroll);