You can think of it as a general CSS list, with just two or three lines of code to complete the switch effect.
<textarea id= "runcode49880" > <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" > <HTML> <HEAD> <TITLE> Text Timing Change Code </TI tle> <style type= "Text/css" > #newslist {background: #f8f8f8; border:1px solid silver;padding:1px;height:20px; line-height:20px;width:288px; } #contain {font-size:12px;overflow:hidden;list-style:none;width:288px;height:20px;margin:0px;padding:0; } #contain li{Height:22px;line-height:22px;white-space:nowrap;overflow:hidden; </style> </HEAD> <BODY> <div id= "newslist" > <ul id= "contain" > <li> Baidu, the world's largest Chinese search Cable engine </li> <LI>CSDN, China's most popular IT technology community </li> <li> Cloud Community </li> <li> player </li> </ul > </div> <script language= "JavaScript" > Function xx () {var Container=document.getelementbyid ("contain") ); Container.appendchild (Container.firstchild); } setinterval ("XX ()", 2000); </SCRIPT> </BODY> </HTML> </textarea>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]