Home  >  Article  >  Web Front-end  >  js marquee code (self-written)_javascript skills

js marquee code (self-written)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:36:451137browse
Copy code The code is as follows:

function cls_marquee(id,id1,id2,sp){
this.obj_id=id;
this.obj_id1=id1;
this.obj_id2=id2;
this.speed=sp;
eval(this.obj_id2 ".innerHTML=" this.obj_id1 " .innerHTML");
function Marquee(){
if(eval(id2).offsetTop-eval(id).scrollTop<=0)
eval(id).scrollTop-=eval(id1) .offsetHeight
else{
eval(id).scrollTop
}
}
var MyMar=setInterval(Marquee,sp)
eval(this.obj_id).onmouseover=function( ) {clearInterval(MyMar)}
eval(this.obj_id).onmouseout=function() {MyMar=setInterval(Marquee,sp)}
}

One I just wrote The small program is generally written. . . . However, this interface is still
Copy code The code is as follows:


< input id="Text1" type="text" value="Welcome to test" />



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