更多>>

專題報道

圖片新聞更多>>

調查研究

更多>>
"; var pupwin=window.open("","_blank","width="+self.width+",height="+self.height+",top="+self.top+",left="+self.left); pupwin.document.write(html); self.isLoaded=true; } this.load=function(){ build(); } } function whirFloatAD(id){ //public this.ID=id; this.type="Float"; this.width=100; this.height=100; //this.top=0; //this.left=0; this.content=""; this.closeButton=true; this.closeButtonHtml="關閉"; this.timeStep=100; this.isLoaded=false; //private var self=this; var timer=null; var contentDiv=document.createElement("DIV"); var rootDiv=document.createElement("DIV"); var xx=yy=vx=vy=0 var vmin=2; var vmax=5; var vx=vmin+vmax*Math.random(); var vy=vmin+vmax*Math.random(); var vr=2; var isHide=false; function build(){ if(self.isLoaded)return; if(self.closeButton==true){ var closeButton=document.createElement("SPAN"); //closeButton.href="javascript:;"; closeButton.innerHTML=self.closeButtonHtml; closeButton.style.cursor="hand"; closeButton.onclick=function(){ self.hide(); } var closeButtonDiv=document.createElement("DIV"); closeButtonDiv.setAttribute("align","right"); closeButtonDiv.style.position="absolute"; closeButtonDiv.style.top="0px"; closeButtonDiv.style.right="0px"; closeButtonDiv.style.margin="2px"; closeButtonDiv.style.padding="2px"; closeButtonDiv.style.zIndex="999"; closeButtonDiv.style.fontSize="12px"; closeButtonDiv.appendChild(closeButton); rootDiv.appendChild(closeButtonDiv); } contentDiv.innerHTML = self.content; rootDiv.style.position="absolute"; rootDiv.style.zIndex="900"; rootDiv.style.display="none"; rootDiv.style.wordBreak="break-all"; rootDiv.style.width = self.width+"px"; rootDiv.style.height = self.height+"px"; //rootDiv.style.border="1px red solid"; rootDiv.style.overflow="hidden"; //rootDiv.style.left = self.left; //rootDiv.style.top = self.top; rootDiv.style.filter= "Alpha(style=0,opacity=100,finishOpacity=100)"; //rootDiv.style.border = "1px solid #ff0000"; rootDiv.onmouseover=function(){ self.stop(); } rootDiv.onmouseout=function(){ self.start(); } rootDiv.appendChild(contentDiv); document.body.appendChild(rootDiv); self.isLoaded=true; } function moveDiv(){ var pageX=pageW=pageY=pageH=0; var isIE=(document.all)?true:false; if(!isIE){ pageX=window.pageXOffset; pageW=window.innerWidth; pageY=window.pageYOffset; pageH=window.innerHeight; }else{ pageX=window.document.body.scrollLeft; pageW=window.document.body.offsetWidth-8; pageY=window.document.body.scrollTop; pageH=window.document.body.offsetHeight; } xx=xx+vx; yy=yy+vy; vx+=vr*(Math.random()-0.5); vy+=vr*(Math.random()-0.5); if(vx>(vmax+vmin)) vx=(vmax+vmin)*2-vx; if(vx<(-vmax-vmin)) vx=(-vmax-vmin)*2-vx; if(vy>(vmax+vmin)) vy=(vmax+vmin)*2-vy; if(vy<(-vmax-vmin)) vy=(-vmax-vmin)*2-vy; if(xx<=pageX){ xx=pageX; vx=vmin+vmax*Math.random(); } if(xx>=pageX+pageW-self.width){ xx=pageX+pageW-self.width; vx=-vmin-vmax*Math.random(); } if(yy<=pageY){ yy=pageY; vy=vmin+vmax*Math.random(); } if(yy>=pageY+pageH-self.height){ yy=pageY+pageH-self.height; vy=-vmin-vmax*Math.random(); } rootDiv.style.display="none"; if(!isIE){ rootDiv.style.left = xx+"px"; rootDiv.style.top = yy+"px"; }else{ rootDiv.style.left = xx+"px"; rootDiv.style.top = yy+"px"; } rootDiv.style.display="inline"; self.start(); } this.hide=function(){ rootDiv.style.display="none"; isHide=true; } this.stop=function(){ window.clearTimeout(timer); timer=null; } this.start=function(){ if(isHide==false){ timer=window.setTimeout(moveDiv,self.timeStep); } //moveDiv(); } this.load=function(){ build(); self.start(); } } function whirScrollAD(id){ this.ID=id; this.type="Scroll"; this.scroll=true; this.closeAll=true; this.closeButton=true; this.closeButtonHtml="關閉"; this.isLoaded=false; var self=this; var items=[]; var timer=null; var closedSize=0; var allClosed=false; var size=0; var lastScrollY=0; function build(){ if(self.isLoaded)return; if(size<1)return false; for(var i=0;i0){ percent=Math.ceil(percent); }else{ percent=Math.floor(percent); } followObj.style.top=(y+percent)+"px"; /* if(followObj.offsetTop!=(diffY+y)) { var dy=(diffY+y-followObj.offsetTop)*delta; dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy)); followObj.style.top=followObj.offsetTop+dy; }*/ } lastScrollY+=percent; } this.load=function(){ build(); timer=window.setInterval(start,100); //document.body.attachEvent("onscroll", start); } } function whirRandPlayAD(id){ this.ID=id; this.type="RandShow"; this.scroll=false; this.isLoaded=false; } function whirOrderPlayAD(id){ this.ID=id; this.type="OrderChange"; this.scroll=false; this.isLoaded=false; } function whirMarqueeAD(id){ var self=this; this.ID=id; this.type="Banner"; this.scroll=false; this.width=0; this.height=0; this.box=null; this.isLoaded=false; var HTML=""; var Box=document.createElement("DIV"); } function whirCurtainAD(id){ var self=this; this.ID=id; this.type="Curtain"; this.width=0; this.height=0; this.direction="top"; this.autoCloseTimer=5; this.content=null; this.speed=1; this.closeButton=true; this.closeButtonHtml="關閉"; this.parentElement=null; this.position="absolute"; this.isLoaded=false; this.marginLeft="0px"; var HTML=""; var Box=null; var timer=null; var autoTimer=null; var delay=5; var isHide=true; var isShow=false; function build(){ if(self.isLoaded)return; var contentDiv=null; if(self.content!=null && typeof(self.content)=="object"){ Box=self.content; if(self.width==0)self.width=Box.offsetWidth; if(self.height==0)self.height=Box.offsetHeight; }else{ Box=document.createElement("DIV"); contentDiv=document.createElement("DIV"); contentDiv.innerHTML = self.content; Box.appendChild(contentDiv); if(self.width==0)self.width=100; if(self.height==0)self.height=100; } if(self.direction=="top" || self.direction=="bottom"){ Box.style.height="0px"; Box.style.width=self.width+"px"; }else{ Box.style.width="0px"; Box.style.height=self.height+"px"; } Box.style.position=self.position; Box.style.display="none"; Box.style.zIndex="900"; Box.style.wordBreak="break-all"; Box.style.overflow="hidden"; Box.style.backgroundColor="#fafafa"; //Box.style.border="1px red solid"; Box.style.marginLeft=self.marginLeft; if(self.closeButton==true){ var closeButton=document.createElement("SPAN"); closeButton.innerHTML=self.closeButtonHtml; closeButton.style.cursor="hand"; closeButton.onclick=function(){ self.close(); } var closeButtonDiv=document.createElement("DIV"); closeButtonDiv.setAttribute("align","right"); closeButtonDiv.style.position="absolute"; closeButtonDiv.style.top="0px"; closeButtonDiv.style.right="0px"; closeButtonDiv.style.margin="2px"; closeButtonDiv.style.padding="2px"; closeButtonDiv.style.zIndex="999"; closeButtonDiv.style.fontSize="12px"; closeButtonDiv.appendChild(closeButton); Box.appendChild(closeButtonDiv); } if(self.content!=null && typeof(self.content)=="object"){ if(self.parentElement!=null){ self.parentElement.appendChild(Box); }else{ self.parentElement=self.content.parentElement; } }else{ if(self.parentElement==null)self.parentElement=document.body; self.parentElement.appendChild(Box); } self.isLoaded=true; } function show(){ isHide=false; Box.style.display=""; if(isShow==true){ if(timer!=null) window.clearInterval(timer); timer=null; return ; } switch(self.direction){ case "top": case "bottom": var h=Box.style.height; h=parseInt(h); h+=delay; if(h>=self.height){ isShow=true; h=self.height; } Box.style.height=h+"px"; if(self.direction=="top"){ Box.style.top="0px"; }else{ //var bh=self.parentElement.offsetHeight; //Box.style.top=(bh-h)+"px"; Box.style.bottom="0px"; } break; case "left": case "right": var w=Box.style.width; w=parseInt(w); w+=delay; if(self.direction=="left"){ Box.style.left="0px"; }else{ Box.style.right="0px"; } if(w>=self.width){ isShow=true; w=self.width; } Box.style.width=w+"px"; break; } } function hide(){ isShow=false; if(isHide==true){ if(timer!=null) window.clearInterval(timer); timer=null; return ; } switch(self.direction){ case "top": case "bottom": var h=Box.style.height; h=parseInt(h); h-=delay; if(h<=0){ h=0; Box.style.display="none"; isHide=true; } Box.style.height=h+"px"; if(self.direction=="top"){ Box.style.top="0px"; }else{ //var t=Box.style.top; //t=parseInt(t)+delay; //Box.style.top=t+"px"; Box.style.bottom="0px"; } break; case "left": case "right": var w=Box.style.width; w=parseInt(w); w-=delay; if(w<=0){ w=0; Box.style.display="none"; isHide=true; } Box.style.width=w+"px"; break; } } this.close=function(){ if(timer!=null) window.clearInterval(timer); if(autoTimer!=null) window.clearTimeout(autoTimer); timer=window.setInterval(hide,self.speed*10); //hide(); } this.load=function(){ build(); timer=window.setInterval(show,self.speed*10); //show(); if(self.autoCloseTimer>0)autoTimer=window.setTimeout(self.close,self.autoCloseTimer*1000); } } whirAD={ ads:new Array(), adCount:0, getAdCount:function(){ return whirAD.adCount; }, NewAdvert:function(id,adType){ var ad=null; switch(adType){ case "Popup": //彈出窗口 ad=whirAD.ads[whirAD.adCount++]=new whirPopupAD(id); break; case "Float": //浮動 ad=whirAD.ads[whirAD.adCount++]=new whirFloatAD(id); break; case "Scroll": //門簾 ad=whirAD.ads[whirAD.adCount++]=new whirScrollAD(id); break; case "RandPlay"://隨機顯示 ad=whirAD.ads[whirAD.adCount++]=new whirRandPlayAD(id); break; case "OrderPlay"://順序切換 ad=whirAD.ads[whirAD.adCount++]=new whirOrderPlayAD(id); break; case "Banner": //固定位置 ad=whirAD.ads[whirAD.adCount++]=new whirBannerAD(id); break; case "Marquee": //滾動 ad=whirAD.ads[whirAD.adCount++]=new whirMarqueeAD(id); break; case "Curtain"://拉幕式 ad=whirAD.ads[whirAD.adCount++]=new whirCurtainAD(id); break; } return ad; }, New:function(id,adType){ return whirAD.NewAdvert(id,adType); }, load:function(){ for(var i=0;i 建昌县| 西宁市| 车险| 乡宁县| 扎鲁特旗| 咸阳市| 荆州市| 尉氏县| 昆山市| 麻栗坡县| 长治市| 交城县| 个旧市| 奎屯市| 吉林省| 星座| 嘉荫县| 天门市| 石家庄市| 穆棱市| 左权县| 阿尔山市| 厦门市| 建瓯市| 通道| 富锦市| 汝州市| 清新县| 桦川县| 山阳县| 淮南市| 九台市| 金昌市| 定州市| 平舆县| 扎鲁特旗| 高州市| 黔西| 淮阳县| 竹山县| 穆棱市| 冀州市| 浑源县| 荃湾区| 玉环县| 山东省| 晋城| 中西区| 寿阳县| 黄大仙区| 浦城县| 和政县| 肇东市| 酉阳| 云龙县| 儋州市| 弥勒县| 垦利县| 太湖县| 大理市| 明星| 南宫市| 贵港市| 吉首市| 常州市| 永嘉县| 连江县| 无极县| 中卫市| 游戏| 开江县| 特克斯县| 马山县| 天门市| 开化县| 亳州市| 滦平县| 大兴区| 永寿县| 额尔古纳市| 佛山市| 临汾市| 东城区| 浦东新区| 阿拉善右旗| 安达市| 岳普湖县| 饶河县| 绍兴市| 泰和县| 孙吴县| 望奎县| 交口县| 浦城县| 晋宁县| 阳江市| 资溪县| 留坝县| 湖南省| 卢氏县| 南汇区| 衡水市| 枞阳县| 屯留县| 黎平县| 舟曲县| 工布江达县| 安图县| 喀喇沁旗| 绥棱县| 怀宁县| 文登市| 和龙市| 柞水县| 天门市| 探索| 乐清市| 吉木萨尔县| 朝阳区| 旬邑县| 禹城市| 财经| 油尖旺区| 台北市| 深州市| 东方市| 肥城市| 外汇| 大理市| 海晏县| 合水县| 夹江县| 嘉定区| 遂溪县| 禄丰县| 扎鲁特旗| 清丰县|