From a0ce83a33299bb2e34939f0eb2516dc65abc53d3 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Wed, 1 Nov 2017 23:10:39 -0700 Subject: [PATCH] Well looks like my scroll listener queueing method was wrong --- index.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index eb37632..ff19697 100644 --- a/index.html +++ b/index.html @@ -255,15 +255,18 @@ var sp = document.getElementById("scrollprompt"); document.addEventListener("scroll", function () { 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); + window.requestAnimationFrame(function () {//"queue up" animation queueing = false; + sc(last_known_scroll); }); + queueing = true; } - queueing = true; + }); + + window.addEventListener("resize",function() { + last_known_scroll = getScrollY(); + sc(last_known_scroll); }); sc(last_known_scroll); @@ -284,7 +287,7 @@ } // var mastHeight = mast.clientHeight; // var halfHeight = Math.floor((topHeight / 2) - (mastHeight / 2)); - if (topHeight < 360) { + if (topHeight < 310) { topDiv.className = "small"; } else { topDiv.className = "large";