if (!ad_marquee) {var ad_marquee = new Array();} function YMarquee(obj, divOBJ) { this.divMarquee = divOBJ; this.Speed = 10; this.StopTime = 1500; this.isBlank = true; this.timerMarquee; this.stopHeight; this.tmpStopHeight = 0; this.divContentHeight; this.scrollMarquee = function() { this.divMarquee.scrollTop+=1; if (parseInt(this.divMarquee.scrollTop)==(this.stopHeight+this.tmpStopHeight)) { this.tmpStopHeight = parseInt(this.divMarquee.scrollTop); this.stop(); return; } var flg; if (this.isBlank) { flg = ((this.divContentHeight+parseInt(this.divMarquee.firstChild.style.height))==(parseInt(this.divMarquee.scrollTop)+1)); } else { flg = (this.divContentHeight==(parseInt(this.divMarquee.scrollTop)+1)); } if (flg) { if (this.isBlank) { this.divMarquee.removeChild(this.divMarquee.firstChild); this.isBlank = false; } this.divMarquee.scrollTop = 0; this.tmpStopHeight = 0; this.stop(); return; } } this.stop = function() { clearInterval(this.timerMarquee); setTimeout(obj+".LoopMarquee()",this.StopTime); } this.LoopMarquee = function() { this.timerMarquee = setInterval(obj+".scrollMarquee();",this.Speed); } this.Start = function() { try { eval(obj); } catch (e) { alert("param 'obj' Error!"); return; } /* if (this.divMarquee!="[object]" && this.divMarquee!="[object HTMLDivElement]") { alert("param 'divOBJ' Error!"); return; } */ if (false) {} else { this.stopHeight = parseInt(divOBJ.style.height); this.divMarquee.innerHTML = '
' + this.divMarquee.innerHTML + '
'; var divContent = this.divMarquee.firstChild.firstChild.firstChild.firstChild; var bottomHeight = parseInt(divContent.offsetHeight)%parseInt(this.divMarquee.style.height); if (bottomHeight!=0) { divContent.innerHTML += '
 
'; } /* this.divContentHeight = parseInt(divContent.offsetHeight); var tmpInnerHTML = divContent.innerHTML; do { divContent.innerHTML += tmpInnerHTML; } while (parseInt(divContent.offsetHeight)<(this.divContentHeight+parseInt(this.divMarquee.style.height))) */ divContent.innerHTML += divContent.innerHTML; this.divContentHeight = 32; //临时 if (this.isBlank) { this.divMarquee.innerHTML = '
 
' + this.divMarquee.innerHTML; } this.LoopMarquee(); } } } function AD_Marquee() { var ad_marquee_id = "ad_marquee_0"; var ad_marquee_i = 0; while (document.getElementById("ad_marquee_"+ad_marquee_i)) { ad_marquee_i++; ad_marquee_id = "ad_marquee_"+ad_marquee_i; } document.write('' + '
' + '
' + '赚积分抽大奖兑现金活动开始啦
' + '
' + '
' ); ad_marquee[ad_marquee_i] = new YMarquee("ad_marquee["+ad_marquee_i+"]", document.getElementById(ad_marquee_id)); ad_marquee[ad_marquee_i].Speed = 80; //滚动速度 ad_marquee[ad_marquee_i].StopTime = 2000; //停顿时间 ad_marquee[ad_marquee_i].isBlank = false; ad_marquee[ad_marquee_i].Start(); } AD_Marquee();