Prova questo:
Codice PHP:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function scroll(el,toType){
var scrollLen= toType.length;
var start= 0;
var timeoutID = window.setInterval(f, 100);
var self= el;
function f(){
if(start<scrollLen){
start++;
var str = toType.substring(start, scrollLen) +' '+ toType.substring(0, start);
if(self.hasChildNodes()){
self.removeChild(self.firstChild);
}
self.appendChild(document.createTextNode(str));
}
else {
window.clearTimeout(timeoutID);
//Pause
setTimeout(f2, 500);
}
}
function f2(){
start= 0;
timeoutID = window.setInterval(f, 100);
}
}
</script>
</head>
<body onload="scroll(document.getElementById('scroll'),'Pippo è andato in montagna');">
<div id="scroll"></div>
</body>
</html>