PageSourceSearch

https://vancouver.knightpiesold.com/fulcrum/js/smoothscroll.js

js knightpiesold.com collected 2026-10-02 08:29:19 UTC 1,105 bytes, 36 lines download raw bytes

1// Scrolling variables
2var delay = 10; //msec
3var steps = 10;
4var scrollInterval;
5function smoothScroll(targetYPos)
6{
7	scrollInterval = setInterval('scrollIt('+targetYPos+')', delay);
8	return false;
9}
10function scrollIt(targetYPos) 
11{
12	wasYPos = getCurrentYPos(); 
13	isAbove = (wasYPos < targetYPos);
14	stepSize = parseInt((targetYPos-wasYPos)/steps) 
15	window.scrollTo(0, wasYPos + stepSize); 
16	isYPos = getCurrentYPos(); 
17	isAboveNow = (isYPos < targetYPos); 
18	if ((isAbove != isAboveNow) || (wasYPos == isYPos)) 
19	{ 
20		// if we've just scrolled past the destination, or 
21		// we haven't moved from the last scroll (i.e., we're at the 
22		// bottom of the page) then scroll exactly to the link 
23		window.scrollTo(0, targetYPos); 
24		clearInterval(scrollInterval);
25	}
26}
27function getCurrentYPos() 
28{ 
29	if (document.body && document.body.scrollTop) 
30	  	return document.body.scrollTop; 
31	if (document.documentElement && document.documentElement.scrollTop) 
32	  	return document.documentElement.scrollTop; 
33	if (window.pageYOffset) 
34	  	return window.pageYOffset; 
35	return 0; 
36} 

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.