Home > front end >  O! Text cyclic display code, not rolling cycle.
O! Text cyclic display code, not rolling cycle.

Time:09-16

Mainly to the a string of text fixed display a certain time, and then a string of words in the direct display , this cycle, scroll up and down around the word I would have, in the baidu search all of this,

CodePudding user response:

 


<meta charset="UTF-8">
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
Document

<body>

<script>
Var arr=[
'aaaaaaaaa'
'BBBBBBBBB'
'CCCCCCCCC'
'DDDDDDDDD'
];
Var index=0;
The function update () {
Document. The getElementById (" textbox "). The innerHTML=arr [index];
Index (index + 1)=% arr. The length;
SetTimeout (update, 2000);
}
The update ();

</script>


CodePudding user response:

reference 1/f, the sky wave response:
 


<meta charset="UTF-8">
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
Document

<body>

<script>
Var arr=[
'aaaaaaaaa'
'BBBBBBBBB'
'CCCCCCCCC'
'DDDDDDDDD'
];
Var index=0;
The function update () {
Document. The getElementById (" textbox "). The innerHTML=arr [index];
Index (index + 1)=% arr. The length;
SetTimeout (update, 2000);
}
The update ();

</script>



Thank you, tomorrow the class was over, I go to my web site under test,
  • Related