[查看演示]
<body>
<script language="JavaScript">
var chars = "\u65AD\u4E86\u7EBF\u7684\u98CE\u7B5D\u25C7\u25C6\u25C7\u25C6\u25C7\u25C6\u25C7\u25C6\u25C7\u25C6\u25C7\u25CE\u25CF\u25CB\u25CF\u25CE\u25CE\u25CF\u25CB\u25CF\u25CE\u25CE\u25CF\u25CB\u25CE\u25CF".split("");
var x, y, objs = [], xp = [], yp = [];
for(i in chars)
{
xp[i] = yp[i] = -50;
objs.push(document.createElement("span"));
objs[i].innerText = chars[i];
objs[i].style.cssText = "font:12px; position:absolute;";
document.body.appendChild(objs[i]);
}
document.onmousemove = function()
{
x = document.body.scrollLeft + event.clientX+10;
y = document.body.scrollTop + event.clientY;
};
window.setInterval(function()
{
for (i = objs.length - 1; i >= 1; i--)
{
xp[i] = xp[i-1] + 12;
yp[i] = yp[i-1];
}
xp[0] = x + 12;
yp[0] = y;
for(i in objs)
{
objs[i].style.posLeft = xp[i];
objs[i].style.posTop = yp[i];
objs[i].style.color = Math.random() * 255 * 255 * 255 + Math.random() * 255 * 255 + Math.random() * 255;
}
}, 20);
</script>
</body>