var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); /** auther:f7 date:2013.03 edit:2013.11 versions:2.0.1 添加:showCallback、hideCallback 接口,仅用于显示和隐藏模块时调用 调整:顶部、底部一定区域停止滚动时不处理display属性 */ function FixedModule(elem,o){if(!(this instanceof FixedModule)){return new FixedModule(elem,o);};var elem=typeof(elem)=="string"?document.getElementById(elem):elem;if(elem.nodeType!=1&&elem.length=="undefined"){return false;};this.elem=elem;this.o=o||{};this.items=[];this.look;this.init(elem,o);this.event();this.cpu();};FixedModule.prototype.getCss=function(who,key){if(who.style[key]!=''){return who.style[key];};if(!!window.ActiveXObject){return who.currentStyle[key];}else{return document.defaultView.getComputedStyle(who,"").getPropertyValue(key.replace(/([A-Z])/g,"-$1").toLowerCase());};};FixedModule.prototype.ie=/msie (\d+\.\d+)/i.test(navigator.userAgent)?(document.documentMode||+RegExp['\x241']):undefined;FixedModule.prototype.on=function(elem,type,listener){type=type.replace(/^on/i,'').toLowerCase();var realListener=listener;if(elem.addEventListener){elem.addEventListener(type,realListener,false);}else if(elem.attachEvent){elem.attachEvent('on'+type,realListener);};return elem;};FixedModule.prototype.getPageHeight=function(){var de=document.documentElement;return document.body.scrollHeight||(de&&de.scrollHeight);};FixedModule.prototype.windowHeight=function(){var de=document.documentElement;return self.innerHeight||(de&&de.offsetHeight)||document.body.offsetHeight;};FixedModule.prototype.init=function(elem,o){if(elem.nodeType==1){this.items.push(elem);}else if(elem.length!="undefined"){this.items=elem;};for(var i=0,l=this.items.length;i=0){_top=elemTop+removeTop;};if(elemBottom>=0){_top=winHeight+removeTop-elemHeight-elemBottom;};elem.style.position="fixed";if(F_T_hide||F_T_hide===0){if(_top<=F_T_hide){elem.style.display="none";if(this.o.hideCallback&&this.look===true){this.o.hideCallback(this);};this.look=false;}else{elem.style.display="block";elem.style.position="fixed";if(this.o.showCallback&&this.look===false){this.o.showCallback(this);};this.look=true;};};if(F_T_stop||F_T_stop===0){if(_top<=F_T_stop){elem.style.position="absolute";elem.style.top=F_T_stop+'px';}else{elem.style.position="fixed";if(this.getCss(elem,"bottom")!="auto"){elem.style.top='auto';}else{elem.style.top=F_I_top+'px';}};};if(F_B_hide||F_B_hide===0){_bottom=pageHeight-_top-elemHeight;if(_bottom<=F_B_hide){elem.style.display="none";if(this.o.hideCallback&&this.look===true){this.o.hideCallback(this);};this.look=false;}else if(F_T_hide&&_top>F_T_hide){elem.style.display="block";elem.style.position="fixed";if(this.o.showCallback&&this.look===false){this.o.showCallback(this);};this.look=true;}else if(!F_T_hide&&_top+F_B_hide=F_I_top){elem.style.display="block";elem.style.position="fixed";elem.style.top=F_W_T_start+'px';}else{elem.style.top=F_I_top+"px";elem.style.position="absolute";};};if(F_W_B_start||F_W_B_start===0){if(winHeight+removeTop>=F_I_top+elemHeight+F_W_B_start){elem.style.display="block";elem.style.position="fixed";elem.style.bottom=F_W_B_start+'px';elem.style.top='auto';}else{elem.style.top=F_I_top+"px";elem.style.position="absolute";};};};FixedModule.prototype.moveIE6=function(elem,elemTop){var myhtml=document.getElementsByTagName('html')[0],mybody=document.getElementsByTagName('body')[0],elemHeight=elem.scrollHeight,removeTop=Math.max(myhtml.scrollTop,mybody.scrollTop),winHeight=this.windowHeight(),pageHeight=this.getPageHeight(),elemTop=parseInt(elemTop);elemBottom=parseInt(this.getCss(elem,'bottom')),_top=0,_bottom=0,F_I_top=parseInt(elem.getAttribute("fixed-init-top")),F_T_hide=parseInt(elem.getAttribute("fixed-top-hide")),F_B_hide=parseInt(elem.getAttribute("fixed-bottom-hide")),F_T_stop=parseInt(elem.getAttribute("fixed-top-stop")),F_B_stop=parseInt(elem.getAttribute("fixed-bottom-stop")),F_T_show=parseInt(elem.getAttribute("fixed-top-show")),F_B_show=parseInt(elem.getAttribute("fixed-bottom-show")),F_W_T_start=parseInt(elem.getAttribute("fixed-win-top-start")),F_W_B_start=parseInt(elem.getAttribute("fixed-win-bottom-start"));if(elemTop>=0){_top=elemTop+removeTop;};if(elemBottom>=0){_top=winHeight+removeTop-elemHeight-elemBottom;};elem.style.top=_top+'px';if(F_T_hide||F_T_hide===0){if(_top<=F_T_hide){elem.style.display="none";if(this.o.hideCallback&&this.look===true){this.o.hideCallback(this);};this.look=false;}else{elem.style.display="block";if(this.o.showCallback&&this.look===false){this.o.showCallback(this);};this.look=true;};};if(F_T_stop||F_T_stop===0){if(_top<=F_T_stop){elem.style.display="block";elem.style.top=F_T_stop+'px';};};if(F_B_hide||F_B_hide===0){_bottom=pageHeight-_top-elemHeight;if(_bottom<=F_B_hide){elem.style.display="none";if(this.o.hideCallback&&this.look===true){this.o.hideCallback(this);};this.look=false;}else if(F_T_hide&&_top>F_T_hide){elem.style.display="block";if(this.o.showCallback&&this.look===false){this.o.showCallback(this);};this.look=true;}else if(!F_T_hide&&_top+F_B_hide=F_I_top){elem.style.display="block";elem.style.top=removeTop+F_W_T_start+'px';}else{elem.style.top=F_I_top+"px";};};if(F_W_B_start||F_W_B_start===0){if(winHeight+removeTop>=F_I_top+elemHeight+F_W_B_start){elem.style.display="block";elem.style.top=winHeight+removeTop-elemHeight-F_W_B_start+'px';}else{elem.style.top=F_I_top+"px";};};}; }