更多>>

專題報道

圖片新聞更多>>

調查研究

更多>>
"; 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 纳雍县| 华池县| 思茅市| 牟定县| 若尔盖县| 扎兰屯市| 宣威市| 平果县| 白沙| 富蕴县| 突泉县| 垫江县| 独山县| 永州市| 鹤庆县| 额敏县| 铜川市| 宜川县| 凤台县| 上饶市| 抚顺市| 涞水县| 洪泽县| 巴塘县| 花莲县| 叶城县| 玉林市| 花莲市| 茌平县| 广灵县| 和龙市| 巨野县| 凤台县| 台州市| 永春县| 霍林郭勒市| 梧州市| 冕宁县| 礼泉县| 焉耆| 邢台市| 上栗县| 黑河市| 高陵县| 怀宁县| 顺义区| 泰州市| 西宁市| 尼勒克县| 兰溪市| 五寨县| 南城县| 南汇区| 东港市| 广灵县| 沽源县| 酒泉市| 松江区| 崇义县| 汉沽区| 清镇市| 白玉县| 霍州市| 万宁市| 延长县| 嘉义市| 浮梁县| 建昌县| 乌什县| 石楼县| 大渡口区| 龙门县| 兴和县| 连州市| 兴宁市| 宿松县| 响水县| 确山县| 都兰县| 屯门区| 朝阳县| 庆安县| 九江市| 永善县| 恭城| 大庆市| 浏阳市| 安远县| 武城县| 商河县| 驻马店市| 天台县| 苏州市| 淮南市| 怀集县| 高平市| 会昌县| 新疆| 临湘市| 潮安县| 双柏县| 南华县| 贺州市| 岳阳市| 松江区| 叶城县| 洛南县| 成武县| 沙坪坝区| 彭泽县| 西畴县| 西吉县| 武汉市| 常熟市| 昆山市| 五台县| 丘北县| 湖口县| 阿图什市| 湄潭县| 南皮县| 肥西县| 大渡口区| 永川市| 南宁市| 怀化市| 汨罗市| 平乐县| 牙克石市| 平塘县| 织金县| 鄂托克旗| 宁乡县| 小金县| 新晃| 金昌市| 始兴县|