1function miaovAddEvent(oEle, sEventName, fnHandler) 2{ 3 if(oEle.attachEvent) 4 { 5 oEle.attachEvent('on'+sEventName, fnHandler); 6 } 7 else 8 { 9 oEle.addEventListener(sEventName, fnHandler, false); 10 } 11} 12 13 14 var oDiv = document.getElementById('miaov_float_layer'); 15 var oBtnMin = document.getElementById('btn_min'); 16 var oBtnClose = document.getElementById('btn_close'); 17 var oDivContent = oDiv.getElementsByTagName('div')[0]; 18 19 var iMaxHeight = 0; 20 21 var isIE6 = window.navigator.userAgent.match(/MSIE 6/ig) && !window.navigator.userAgent.match(/MSIE 7|8/ig); 22 23 oDiv.style.display = 'block'; 24 iMaxHeight = oDivContent.offsetHeight; 25 26 if (isIE6) { 27 oDiv.style.position = 'absolute'; 28 repositionAbsolute(); 29 miaovAddEvent(window, 'scroll', repositionAbsolute); 30 miaovAddEvent(window, 'resize', repositionAbsolute); 31 } 32 else { 33 oDiv.style.position = 'fixed'; 34 repositionFixed(); 35 miaovAddEvent(window, 'resize', repositionFixed); 36 } 37 38 oBtnMin.timer = null; 39 oBtnMin.isMax = true; 40 oBtnMin.onclick = function() { 41 startMove 42 ( 43 oDivContent, (this.isMax = !this.isMax) ? iMaxHeight : 0, 44 function() { 45 oBtnMin.className = oBtnMin.className == 'min' ? 'max' : 'min'; 46 } 47 ); 48 }; 49 50 oBtnClose.onclick = function() { 51 oDiv.style.display = 'none'; 52 oDiv.innerHTML = ""; 53 }; 54 55 56function startMove(obj, iTarget, fnCallBackEnd) 57{ 58 if(obj.timer) 59 { 60 clearInterval(obj.timer); 61 } 62 obj.timer=setInterval 63 ( 64 function () 65 { 66 doMove(obj, iTarget, fnCallBackEnd); 67 },30 68 ); 69} 70 71function doMove(obj, iTarget, fnCallBackEnd) 72{ 73 var iSpeed=(iTarget-obj.offsetHeight)/8; 74 75 if(obj.offsetHeight==iTarget) 76 { 77 clearInterval(obj.timer); 78 obj.timer=null; 79 if(fnCallBackEnd) 80 { 81 fnCallBackEnd(); 82 } 83 } 84 85 else 86 { 87 iSpeed=iSpeed>0?Math.ceil(iSpeed):Math.floor(iSpeed); 88 obj.style.height=obj.offsetHeight+iSpeed+'px'; 89 90 ((window.navigator.userAgent.match(/MSIE 6/ig) && window.navigator.userAgent.match(/MSIE 6/ig).length==2)?repositionAbsolute:repositionFixed)() 91 } 92} 93 94function repositionAbsolute() 95{ 96 var oDiv=document.getElementById('miaov_float_layer'); 97 var top=document.body.scrollTop||document.documentElement.scrollTop; 98 var width=document.documentElement.clientWidth; 99 var height=document.documentElement.clientHeight; 100 101 oDiv.style.top=top+height-oDiv.offsetHeight+'px'; 102} 103 104function repositionFixed() 105{ 106 var oDiv=document.getElementById('miaov_float_layer'); 107 var width=document.documentElement.clientWidth; 108 var height=document.documentElement.clientHeight; 109 110 oDiv.style.top=height-oDiv.offsetHeight+'px'; 111}
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.