Skip to content

Instantly share code, notes, and snippets.

@helieting
Created February 26, 2014 17:39
Show Gist options
  • Select an option

  • Save helieting/9234464 to your computer and use it in GitHub Desktop.

Select an option

Save helieting/9234464 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<form name="textform">
<div align="center">
<p>
<textarea class="textfield" name="textfield" rows="26" cols="90"></textarea>
</p>
</div>
</form>
</body>
</html>
var pos = 0;
var strText = "\n \n I'm shooting for the stars. \n \n I'm aiming for the moon. \n \n I'm soasing towards the highest mountains. \n \n I know I'll get there soon. \n \n I'm reaching with all my might. \n \n Towards a goal that's mine. \n \n I'm trying harder every day. \n \n To reach the finish line. \n \n That brilliant light ahead. \n \n Is where I need to be. \n \n A place of honor and pride. \n \n A place of victory.";
function ShowText(content) {
document.textform.textfield.value = content.substring(0, pos++);
setTimeout("ShowText(strText)", 50);
if (pos == strText.length) {
return;
}
}
ShowText(strText);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment