Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder howie2009's Avatar
    Join Date
    May 2009
    Location
    Ireland
    Posts
    206
    Thanks
    37
    Thanked 0 Times in 0 Posts

    typing text effect

    Hi,
    I saw a tyoing text effect on http://www.atlanticair.ie/Default.aspx under the banner and was wondering if anyone knows where i can get the code to build such an effect.
    Thanks

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,461
    Thanks
    11
    Thanked 600 Times in 580 Posts
    Quote Originally Posted by howie2009 View Post
    Hi,
    I saw a tyoing text effect on http://www.atlanticair.ie/Default.aspx under the banner and was wondering if anyone knows where i can get the code to build such an effect.
    Thanks
    a simple example:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<title>typer demo</title>
    </head>
    <body>
      <h1>typer demo</h1>	
      <div id='typeHere'>
    	
    </div>	
      
    <script type='text/javascript'>
    
    function oneCharAtATime(elm, text, CPS ){
    	if(elm.blink){ elm=document.getElementById(elm);}
    	var wds=text.split("");
    	var delay = CPS ? (1000 / CPS) : 120;
    	var  buff = "", ii=0;
    	var mx=wds.length;
    	for(z=0;z<mx; z = z + 1){
            	 setTimeout( function(){
    			buff = buff  +  wds[ii++] ;
    			if(elm.value != undefined ){ elm.value = buff; return;}
    			if(elm.innerHTML != undefined){ elm.innerHTML = buff; return; }
    		}, z * delay );
    	}//nxt
    }//end oneCharAtATime()
    
    
    window.onload= function (){
    	oneCharAtATime("typeHere", "Now is the time for all good men to come to the aid of their party.", 25)//more for faster, less for slower
    }
    </script>
    </body>
    </html>
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •