...

View Full Version : typing text effect



howie2009
06-21-2009, 01:54 PM
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

abduraooft
06-21-2009, 01:59 PM
http://www.dynamicdrive.com/dynamicindex10/text5.htm

rnd me
06-21-2009, 11:39 PM
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:


<!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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum