Status Bar Ticker
Simulate a teletype machine. This script types out your message one letter at a time, pauses, and then restarts.
_
Copy the Script
<script>
var text = "Breaking News: JavaScript is fun!";
var delay = 100;
var currentChar = 1;
function type() {
document.getElementById("ticker").innerText = text.substring(0, currentChar) + "_";
currentChar++;
if(currentChar > text.length + 5) currentChar = 1; // Loop
setTimeout("type()", delay);
}
</script>
<div id="ticker"></div>
Frequently Asked Questions
Scrolling moves the entire text loop horizontally. A ticker (or typewriter) adds one character at a time until the message is complete, creating a typing animation.
Yes! This logic is perfect for displaying a news headline or announcement at the top of your page inside a `div`.