PageSourceSearch

https://oyako-kintore.jp/js/fixmenu_pagetop.js

js oyako-kintore.jp collected 2026-10-04 13:23:31 UTC 1,151 bytes, 42 lines download raw bytes

1/*
2 fix menu
3 2017/01/26 crytus corporation.
4*/
5function fm_hasClass(e, c)
6{
7    var classes = e.className;
8    if (!classes) return false;
9    if (classes === c) return true;
10    return classes.search("\\b" + c + "\\b") != -1;
11}
12function fm_addClass(e, c)
13{
14    if (fm_hasClass(e, c)) return;
15    var classes = e.className;
16    if (classes && classes[classes.length-1] != " ")
17        c = " " + c;
18    e.className += c;
19}
20function fm_removeClass(e, c)
21{
22    var pattern = new RegExp("\\b" + c + "\\b\\s*", "g");
23    e.className = e.className.replace(pattern, "");
24}
25function fm_addEvent(elm,listener,fn){
26	try{
27		elm.addEventListener(listener,fn,false);
28	}catch(e){
29		elm.attachEvent("on"+listener,fn);
30	}
31}
32fm_addEvent(window, 'load', function() {
33   var offsettop;
34   offsettop = 350;
35   fm_addEvent(window, 'scroll', function() {
36   if (offsettop < Math.max(document.body.scrollTop,document.documentElement.scrollTop)) {
37       fm_addClass(document.body, 'is-fixed-pagetop');
38   } if ((offsettop - 50) > Math.max(document.body.scrollTop,document.documentElement.scrollTop)) {
39       fm_removeClass(document.body, 'is-fixed-pagetop');
40   }
41 });
42});

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.