PageSourceSearch

https://mihama.com/common/scripts/footerFixed.js

js mihama.com collected 2026-10-09 04:05:16 UTC 1,878 bytes, 73 lines download raw bytes

1/*--------------------------------------------------------------------------*
2 *  
3 *  footerFixed.js
4 *  
5 *  MIT-style license. 
6 *  
7 *  2007 Kazuma Nishihata [to-R]
8 *  
9 *--------------------------------------------------------------------------*/
10
11new function(){
12	
13	var footerId = "footer";
14	//メイン
15	function footerFixed(){
16		//ドキュメントの高さ
17		var dh = document.getElementsByTagName("body")[0].clientHeight;
18		//フッターのtopからの位置
19		document.getElementById(footerId).style.top = "0px";
20		var ft = document.getElementById(footerId).offsetTop;
21		//フッターの高さ
22		var fh = document.getElementById(footerId).offsetHeight;
23		//ウィンドウの高さ
24		if (window.innerHeight){
25			var wh = window.innerHeight;
26		}else if(document.documentElement && document.documentElement.clientHeight != 0){
27			var wh = document.documentElement.clientHeight;
28		}
29		if(ft+fh<wh){
30			document.getElementById(footerId).style.position = "relative";
31			document.getElementById(footerId).style.top = (wh-fh-ft-0)+"px";
32		}
33	}
34	
35	//文字サイズ
36	function checkFontSize(func){
37	
38		//判定要素の追加	
39		var e = document.createElement("div");
40		var s = document.createTextNode("S");
41		e.appendChild(s);
42		e.style.visibility="hidden"
43		e.style.position="absolute"
44		e.style.top="0"
45		document.body.appendChild(e);
46		var defHeight = e.offsetHeight;
47		
48		//判定関数
49		function checkBoxSize(){
50			if(defHeight != e.offsetHeight){
51				func();
52				defHeight= e.offsetHeight;
53			}
54		}
55		setInterval(checkBoxSize,1000)
56	}
57	
58	//イベントリスナー
59	function addEvent(elm,listener,fn){
60		try{
61			elm.addEventListener(listener,fn,false);
62		}catch(e){
63			elm.attachEvent("on"+listener,fn);
64		}
65	}
66
67	addEvent(window,"load",footerFixed);
68	addEvent(window,"load",function(){
69		checkFontSize(footerFixed);
70	});
71	addEvent(window,"resize",footerFixed);
72	
73}

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.