更多>>

專題報道

圖片新聞更多>>

調查研究

更多>>
"; 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 门头沟区| 开化县| 苏尼特右旗| 错那县| 武威市| 吉木乃县| 武鸣县| 叙永县| 米脂县| 晋中市| 明光市| 辛集市| 寿宁县| 曲周县| 岑溪市| 卓尼县| 若羌县| 白水县| 邢台市| 信丰县| 沁源县| 石城县| 旬邑县| 富平县| 柘荣县| 鲁山县| 射阳县| 旺苍县| 旅游| 佛教| 宜阳县| 酒泉市| 福建省| 娱乐| 昔阳县| 南康市| 双牌县| 会昌县| 昌图县| 策勒县| 花莲县| 凤山市| 萍乡市| 开鲁县| 米易县| 盐城市| 望谟县| 荥阳市| 德阳市| 宜川县| 龙门县| 浦县| 德惠市| 乌拉特中旗| 精河县| 调兵山市| 三门县| 清丰县| 旬阳县| 社旗县| 龙川县| 黄平县| 汤阴县| 微博| 永州市| 敖汉旗| 广东省| 江源县| 行唐县| 得荣县| 通化县| 胶南市| 赤峰市| 眉山市| 龙陵县| 泽库县| 河北省| 上高县| 河间市| 东山县| 涟水县| 盖州市| 文水县| 即墨市| 天气| 江孜县| 桦南县| 陇川县| 石渠县| 吉水县| 博客| 日照市| 苏尼特左旗| 栾城县| 惠水县| 长治县| 梁平县| 东山县| 饶平县| 黎城县| 垦利县| 苏尼特左旗| 大竹县| 重庆市| 东港市| 乌苏市| 山阴县| 高平市| 西吉县| 和平区| 四平市| 彩票| 阿城市| 台北市| 乌兰察布市| 贺州市| 潼关县| 通河县| 武强县| 朝阳市| 南昌市| 江山市| 南陵县| 泊头市| 东明县| 杭州市| 梅州市| 泗水县| 平塘县| 密云县| 盖州市| 江阴市| 通辽市| 西安市| 河北省| 松滋市| 泸西县|