1/*--------------------------------------------------------------------------* 2 * 3 * footerFixed.js 4 * 5 * MIT-style license. 6 * 7 * 2007 Kazuma Nishihata [to-R] 8 * http://blog.webcreativepark.net 9 * 10 *--------------------------------------------------------------------------*/ 11 12new function(){ 13 14 var footerId = "footer"; 15 //ã¡ã¤ã³ 16 function footerFixed(){ 17 //ããã¥ã¡ã³ãã®é«ã 18 var dh = document.getElementsByTagName("body")[0].clientHeight; 19 //ããã¿ã¼ã®topããã®ä½ç½® 20 document.getElementById(footerId).style.top = "0px"; 21 var ft = document.getElementById(footerId).offsetTop; 22 //ããã¿ã¼ã®é«ã 23 var fh = document.getElementById(footerId).offsetHeight; 24 //ã¦ã£ã³ãã¦ã®é«ã 25 if (window.innerHeight){ 26 var wh = window.innerHeight; 27 }else if(document.documentElement && document.documentElement.clientHeight != 0){ 28 var wh = document.documentElement.clientHeight; 29 } 30 if(ft+fh<wh){ 31 document.getElementById(footerId).style.position = "relative"; 32 document.getElementById(footerId).style.top = (wh-fh-ft-1)+"px"; 33 } 34 } 35 36 //æåãµã¤ãº 37 function checkFontSize(func){ 38 39 //å¤å®è¦ç´ ã®è¿½å 40 var e = document.createElement("div"); 41 var s = document.createTextNode("S"); 42 e.appendChild(s); 43 e.style.visibility="hidden" 44 e.style.position="absolute" 45 e.style.top="0" 46 document.body.appendChild(e); 47 var defHeight = e.offsetHeight; 48 49 //å¤å®é¢æ° 50 function checkBoxSize(){ 51 if(defHeight != e.offsetHeight){ 52 func(); 53 defHeight= e.offsetHeight; 54 } 55 } 56 setInterval(checkBoxSize,1000) 57 } 58 59 //ã¤ãã³ããªã¹ãã¼ 60 function addEvent(elm,listener,fn){ 61 try{ 62 elm.addEventListener(listener,fn,false); 63 }catch(e){ 64 elm.attachEvent("on"+listener,fn); 65 } 66 } 67 68 addEvent(window,"load",footerFixed); 69 addEvent(window,"load",function(){ 70 checkFontSize(footerFixed); 71 }); 72 addEvent(window,"resize",footerFixed); 73 74}
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.