Well looks like my scroll listener queueing method was wrong
This commit is contained in:
		
							
								
								
									
										15
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								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"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user