Skip to content

Instantly share code, notes, and snippets.

@motyar
Created April 7, 2011 10:03
Show Gist options
  • Save motyar/907472 to your computer and use it in GitHub Desktop.
Save motyar/907472 to your computer and use it in GitHub Desktop.
function typewriter(el,text,pos,no){
ctext=text.substring(0,pos)+(pos%2?'_':'<blink>_</blink>');
$(el).html(ctext);
if(pos==text.length){
$(el).html(text+"<blink>_</blink>");
}
else
window.setTimeout('typwriter("'+el+'","'+text+'",'+(pos+1)+','+1+');',800);
}
function typwriter(el,text,pos,no){
ctext=text.substring(0,pos)+(pos%2?'_':'<blink>_</blink>');
$(el).html(ctext);
if(pos==22){
$(el).html("We are coming soon!!^Z<br />       1 file(s) copied.<br />
<br />HTTP:\\motyar.com><span id=\"slide-client2\"><blink>
_</blink></span>");
typwriter('#slide-client2',"index.html ",0,2);
}
else
if(pos==text.length){
$(el).html(text+"<blink>_</blink>");
if(text=="index.html "){
$(document.body).css( "background-color", "white" )
$("#result").load("comingsoon.html"); };
}
else
window.setTimeout('typwriter("'+el+'","'+text+'",'+(pos+1)+','+1+');',800);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment