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