JS Typewriter effect Code _javascript tips

Source: Internet
Author: User

<ptml><pead><title>type write</title><style type= "Text/css" >a{text-decoration:none }</style></pead><body> <div id= "Newsticker" ><span id= "Tickertitle" ></span> </div> </body> </ptml> <script type= "Text/javascript" >//Please keep this lines on when Copy the source//made by:nicolas-http://www.javascript-page.com var current = 0 var x = 0 var speed = 70 var speed2 = Initarray function (n) {this.length = n; for (var i =1 i <= n; i++) {this[i] = '}} typ = new Initarray (16); Typ[0]= "406:red:texas last in the US Gov state Governors Websites (June 2008)"; typ[1]= "409:red:the Insolvency Service last in UK government (June 2008)"; typ[2]= "384:green:federated States of Micronesia 1st in US Gov State and territorial Government Websites (April 2008)"; Typ[3]= "413:green:u.s. Immigration and Customs enforcement highest climber in the US goV Agencies (up 188)-June 2008 "; typ[4]= "371:green:iowa 1st in the US Gov state Governors Websites (April 2008)"; typ[5]= "373:green:directgov Jobs and Skills 1st in UK Government (April 2008)"; Typ[6]= "379:red:birmingham in UK Government (April 2008)"; Typ[7]= "406:green:utah highest climber in US Gov. Governors Websites (UP)-June 2008"; typ[8]= "380:red:kent Police greatest Faller in Police forces (down)-April 2008"; function Typewrite () {var m = typ[current]; document.getElementById ("Typewriter"). href = '/survey/report.html?rt= ' + m.substring (0,m.indexof (': ')); m = m.substring (M.indexof (': ') + 1); document.getElementById ("Typewriter"). Style.color = m.substring (0,m.indexof (': ')); m = m.substring (M.indexof (': ') + 1); m = M.replace ("&", "and"); document.getElementById ("Typewriter"). InnerHTML = m.substring (0, x + +) + "_"; if (x = = M.length + 1) {x = 0 current++ if (current > Typ.length-1) {current = 0} settimeout ("Typewrite ()", Speed2)} else {settimeout ("t Ypewrite () ", Speed)}}//document.getelementbyid (" Tickertitle "). InnerHTML =" Latest: "; /*document.getelementbyid ("Smheadlines"). Style.padding = "10px"; * * Typewrite () </script>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.