PageSourceSearch

https://e-nrp.org/js/scroll_change_menu.js

js e-nrp.org collected 2026-10-03 23:52:21 UTC 1,099 bytes, 30 lines download raw bytes

1changeMenu();
2document.getElementsByTagName("BODY")[0].onresize = function() {changeMenu()};
3
4function changeMenu() {
5    if (window.innerWidth < 960) {
6      //console.log('add function')
7      var prevScrollpos = window.pageYOffset;
8      window.onscroll = function() {
9        var currentScrollPos = window.pageYOffset;
10        if (prevScrollpos > currentScrollPos) {
11          document.querySelector('.masthead.sticky-top').style.top = "0";
12        } else {
13          document.querySelector('.masthead.sticky-top').style.top = "-73px";
14        }
15        prevScrollpos = currentScrollPos;
16      };
17    } else {
18      //console.log('remove funtion')
19      var prevScrollpos = window.pageYOffset;
20      window.onscroll = function() {
21        var currentScrollPos = window.pageYOffset;
22        if (prevScrollpos > currentScrollPos) {
23          document.querySelector('.masthead.sticky-top').style.top = "0";
24        } else {
25          document.querySelector('.masthead.sticky-top').style.top = "0";
26        }
27        prevScrollpos = currentScrollPos;
28      };
29    }
30};

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.