Wait for animation frame
This commit is contained in:
parent
7ed9065ee9
commit
cfa0a137af
16
index.html
16
index.html
@ -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);
|
// 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
|
// 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) {
|
if (!queueing) {
|
||||||
// window.requestAnimationFrame(function() {
|
window.requestAnimationFrame(function() {
|
||||||
// sc(last_known_scroll);
|
sc(last_known_scroll);
|
||||||
// queueing = false;
|
queueing = false;
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// queueing = true;
|
queueing = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
sc(last_known_scroll);
|
sc(last_known_scroll);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user