Text Follows The Cursor
mouse and cursor 1999 still worksYour message orbits the mouse pointer, one letter per trailing position.
In 2026: Works. This was the single most-copied script on the 1999 web.
Where it came from: Usually credited to Peter Gehrig and Urs Dudli of 24Fun, whose header comment survives in copies all over the web, 1999. MDN ↗
<script language="JavaScript">
var FMSG = "xbawx.com ";
var chars = [];
for (var i = 0; i < FMSG.length; i++) {
var c = document.createElement("div");
c.innerHTML = FMSG.charAt(i);
c.style.cssText = "position:fixed;left:0;top:0;pointer-events:none;z-index:9999;"
+ "font:bold 14px Verdana;color:#FF00AA";
document.body.appendChild(c);
chars.push({ el: c, x: 0, y: 0 });
}
var cx = 0, cy = 0, step = 0;
document.onmousemove = function (e) { cx = e.clientX; cy = e.clientY; };
setInterval(function () {
step += 0.28;
for (var i = 0; i < chars.length; i++) {
var a = step - i * 0.45;
var tx = cx + Math.cos(a) * (24 + i * 3);
var ty = cy + Math.sin(a) * (24 + i * 3);
chars[i].x += (tx - chars[i].x) * 0.4;
chars[i].y += (ty - chars[i].y) * 0.4;
chars[i].el.style.left = chars[i].x + "px";
chars[i].el.style.top = chars[i].y + "px";
}
}, 30);
</script>