Home  >  Article  >  Web Front-end  >  js script that text links appear one by one_advertising code

js script that text links appear one by one_advertising code

WBOY
WBOYOriginal
2016-05-16 19:07:111077browse

I found this code when browsing the website, it is very good, the height is 20, text advertisement
calling code:

Copy code The code is as follows:

var marqueeContent =new Array(); //Scrolling theme                                                                                                                                                                                                                                                                              since a>';
marqueeContent[1]='Google AdSense';
marqueeContent[2]='Firefox browser download';
marqueeContent[3]='Advertising space for rent throughout the site ';
marqueeContent[4]='Full site data download site' ;
marqueeContent[5]='Google AdSense';
marqueeContent[6]='Full site data download site';
var marqueeInterval=new Array( ); //Define some commonly used and frequently used variables
var marqueeId=0;
var marqueeDelay=4000;
var marqueeHeight=20;
function initMarquee() {
var str=marqueeContent[0];
document.write('
' str '
');
marqueeId ;
marqueeInterval[0]= setInterval("startMarquee()",marqueeDelay);
}
function startMarquee() {
var str=marqueeContent[marqueeId];
marqueeId;
if(marqueeId>=marqueeContent.length ) marqueeId=0;
if(marqueeBox.childNodes.length==1) {
var nextLine=document.createElement('DIV');
nextLine.innerHTML=str;
marqueeBox.appendChild (nextLine);
}
else {
marqueeBox.childNodes[0].innerHTML=str;
marqueeBox.appendChild(marqueeBox.childNodes[0]);
marqueeBox.scrollTop=0 ;
}
clearInterval(marqueeInterval[1]);
marqueeInterval[1]=setInterval("scrollMarquee()",10);
}
function scrollMarquee() {
marqueeBox.scrollTop;
if(marqueeBox.scrollTop%marqueeHeight==marqueeHeight){
clearInterval(marqueeInterval[1]);
}
}
initMarquee();

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn