Letter by letter scroll
Updated: 01/31/2019 by Computer Hope
Example
Below, the message "There is Hope - Computer Hope" should display, letter by letter.
Source code
<p id="scroller"></p>
<script type="text/javascript">
// Original: Pun Man Kit [email protected]
function scroll(position) {
var msg = "There is Hope - Computer Hope.";
var out = "";
var sc = document.getElementById("scroller");
for (var i=0; i < position; i++){
out += msg.charAt(i);
}
out += msg.charAt(position);
sc.innerHTML = out;
position++;
if (position != msg.length) {
window.setTimeout(function() { scroll(position); }, 50); }
else {
window.setTimeout(function() { scroll(0); }, 2000);
}
}
scroll(0);
</script>