PageSourceSearch

https://responsibility.com/wp-content/themes/responsibility/js/scrollTo.js

js responsibility.com collected 2026-10-03 21:38:32 UTC 1,405 bytes, 53 lines download raw bytes

1// JavaScript Document
2function scrollToSmoothly(pos, time) {
3    /*Time is only applicable for scrolling upwards*/
4    /*Code written by hev1*/
5    /*pos is the y-position to scroll to (in pixels)*/
6    if (isNaN(pos)) {
7        throw "Position must be a number";
8    }
9    if (pos < 0) {
10        throw "Position can not be negative";
11    }
12    var currentPos = window.scrollY || window.screenTop;
13
14    if (currentPos < pos) {
15        if (time) {
16            var x;
17            var i = currentPos;
18            x = setInterval(function () {
19                window.scrollTo(0, i);
20                i += 16;
21                if (i >= pos) {
22                    clearInterval(x);
23                }
24            }, time);
25        } else {
26            var t = 16;
27            for (let i = currentPos; i <= pos; i += 16) {
28                t += 16;
29                setTimeout(function () {
30                    window.scrollTo(0, i);
31                }, t / 2);
32            }
33        }
34    } else {
35        time = time || 4;
36        var i = currentPos;
37        var x;
38        x = setInterval(function () {
39            window.scrollTo(0, i);
40            i -= 16;
41            if (i <= pos) {
42                clearInterval(x);
43            }
44        }, time);
45    }
46
47}
48
49function scrollToDiv(divID) {
50    var elem = document.getElementById(divID);
51    var offset = elem.offsetTop + 100;
52    scrollToSmoothly(offset, 1);
53}

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.