JQ Typing effect

Source: Internet
Author: User

<!DOCTYPE HTML><HTMLLang= "en"><Head><MetaCharSet= "UTF-8"><title>JQ subtitle Typing effect</title><style>*{margin:0;padding:0;}Body{Background-color:#000;Color:#00FF00;padding:100px;font-size:30px;}. Hide{Display:None;}</style></Head><Body><!--div for output text -<DivID= "Showbox"></Div><!--text that you want to output -<Divclass= "Hide"ID= "Contowrite">Login:username<BR>Password: ******<BR>Access is granted<BR>What about Chinese? </Div><Scriptsrc= "Http://www.lamahui.com/static/1.0/js/base/v1.js"></Script><Script>$(function () {    varShowbox= $('#showBox'),    //Text OutputCon= $('#conToWrite'),    //text that you want to outputtext= NULL, CharIndex= -1, Len= 0; functionwritecontent (init) {if(init) {text=con.html (); }        if(CharIndex=== -1) {CharIndex= 0; Len=text.length; }        varinitstring=showbox.html (); Initstring=Initstring.replace (/<span.*$/gi,"'); varTheChar=Text.charat (CharIndex); varNextfourchars=text.substr (CharIndex,4); if(Nextfourchars=== '<br>' ||Nextfourchars=== '<BR>') {TheChar= '<br>'; CharIndex+= 3; } initstring=initstring+TheChar+ "<span id= ' blink ' >_</span>";        Showbox.html (initstring); CharIndex=CharIndex/1 + 1;        if(CharIndex% 2 === 1 ) {            $('#blink'). Hide (); } Else {            $('#blink'). Show (); }        if(CharIndex<=Len) {SetTimeout (function() {writecontent (false); },  Max); } Else{Blinkspan (); }    }    varCurrentstyle= 'inline'; functionBlinkspan () {if(Currentstyle=='inline') {Currentstyle='None'; }Else{Currentstyle='inline'; }        $('#blink'). CSS ('Display', Currentstyle); SetTimeout (function() {Blinkspan (); }, -); } writecontent (true);});</Script></Body></HTML>

Effects such as:

JQ Typing effect

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.