Awesome Java app

Sep 07, 2005 15:26

I'd put this in here in Net/Web for some friends to copy to their pages, so anyone else who's interested can have it as well. Definitely NOT my creation! It puts moving text on the very bottom of your page.

< script language="JavaScript" >
var current = 0
var x = 0
var speed = 50
var speed2 = 1000
function initArray(n) {
this.length = n;
for (var i =1; i <= n; i++) {
this[i] = ' '
}
}
typ = new initArray(8)
typ[0]=" After a day of cloud and wind and rain"
typ[1]=" Sometimes the setting sun breaks out again"
typ[2]=" And touching all the darksome woods with light"
typ[3]=" Smiles on the fields until they laugh and sing"
typ[4]=" Then like a ruby from the horizon's ring"
typ[5]=" Drops down into the night."
typ[6]=" -Henry Wadsworth Longfellow"
typ[7]=" Hanging of the Crane"
function typewrite() {
var m = typ[current]
window.status = m.substring(0, x++) + ""
if (x == m.length + 1) {
x = 0
current++
if (current > typ.length - 1) {
current = 0
}
setTimeout("typewrite()", speed2)
}
else {
setTimeout("typewrite()", speed)
}
}
typewrite()//
< script >< /script >
Previous post Next post
Up