PageSourceSearch

https://htmlreference.io/javascript/collection.js

js htmlreference.io collected 2026-10-03 19:37:56 UTC 1,015 bytes, 35 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function() {
2  var $root = document.documentElement;
3  var $alo = document.getElementById('alo');
4  var $bsaShadow = document.getElementById('bsaShadow');
5
6  var toTravel = $root.scrollHeight - window.innerHeight;
7  var fromTop = $alo.offsetTop;
8  var menuThrottle = null;
9
10  if ($alo) {
11    document.addEventListener('scroll', function(event) {
12      var scrollTop = window.scrollY;
13      setBsa(scrollTop);
14      clearTimeout(menuThrottle);
15      throttle = setTimeout(setBsaShadows(scrollTop), 100);
16    });
17
18    function setBsaShadows(scrollTop) {
19      var distance = toTravel - scrollTop;
20      var topFactor = 1 - (distance / toTravel);
21      $bsaShadow.style.opacity = topFactor;
22      $bsaShadow.style.transform = 'scaleY(' + topFactor + ')';
23    }
24
25    function setBsa(scrollTop) {
26      if (scrollTop >= fromTop) {
27        $alo.classList.add('is-fixed');
28      } else {
29        $alo.classList.remove('is-fixed');
30      }
31    }
32
33    setBsaShadows(0);
34  }
35});

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.