Copy codeThe 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 )}
}
I just wrote a small program, which is fully written .... However, this interface is still
Copy codeThe Code is as follows:
<Script type = "text/javascript">
Function show (){
Var info = document. getElementById ('text1 ');
Info. value = info. value. substr (1) + info. value [0];
}
SetInterval (show, 500 );
Function show1 (){
Var info1 = document. getElementById ('text2 ');
Info1.value = info1.value [info1.value. length-1] + info1.value. substr (0, info1.value. length-1 );
}
SetInterval (show1, 500 );
</Script>
<Input id = "Text1" type = "text" value = "Welcome to test"/>
<Input id = "Button1" type = "button" value = "scroll"/> <br/>
<Input id = "Text2" type = "text" value = "Welcome to Beijing"/>
<Input id = "Button2" type = "button" value = "scroll" onclick = "show1 ()"/>