PageSourceSearch

https://sp.icst.edu.ph/js/scrolling.js

js icst.edu.ph collected 2026-10-02 23:47:48 UTC 1,261 bytes, 49 lines download raw bytes

1// left: 37, up: 38, right: 39, down: 40,
2// spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36
3var keys = {37: 1, 38: 1, 39: 1, 40: 1};
4
5function preventDefault(e) {
6  e=e || window.event;
7  if (e.preventDefault)
8    e.preventDefault();
9  e.returnValue = false;  
10}
11
12function preventDefaultForScrollKeys(e) {
13  if (keys[e.keyCode]) {
14    preventDefault(e);
15    return false;
16  }
17}
18
19function disableScroll() {
20  if (window.addEventListener) // older FF
21    window.addEventListener('DOMMouseScroll', preventDefault, false);
22  window.onwheel=preventDefault; // modern standard
23  window.onmousewheel=document.onmousewheel=preventDefault; // older browsers, IE
24  window.ontouchmove=preventDefault; // mobile
25  document.onkeydown=preventDefaultForScrollKeys;
26}
27
28function enableScroll() {
29  if (window.removeEventListener)
30    window.removeEventListener('DOMMouseScroll', preventDefault, false);
31  window.onmousewheel=document.onmousewheel=null; 
32  window.onwheel=null; 
33  window.ontouchmove=null;  
34  document.onkeydown=null;  
35}
36
37/*
38
39function noscroll() {
40  window.scrollTo( 0, 0 );
41}
42
43// add listener to disable scroll
44//window.addEventListener('scroll', noscroll);
45
46// Remove listener to disable scroll
47//window.removeEventListener('scroll', noscroll);
48
49*/

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.