Scroller
<title>Scroller</title>
<SCRIPT LANGUAGE="javascript">
<!--
//-------------------------------------------------------------------------------
// Slide Scroller.
// Written by Rick Glusick, May 1997.
//
// This code may be copied, used and modified as long as this banner
// is left intact and attached to this code. Please use at your own risk.
// I am not responsible for any damage caused by this function.
//
// Email : glusick@dave-world.net
// Copyright 1997
//-------------------------------------------------------------------------------
var repeat = true; // repite indefinidamente o muestra sólo una vez el texto.
// indicator. Los Valores son los siguientes:
// - false = muestra la línea de texto solo una vez.
// - true = realiza un loop.
var numLines = 3; // indica el nro de líneas que iremos a mostrar
var phrase = new Array(numLines);
phrase[1] = "Este es un ejemplo de el 'Slide' scroller.";
phrase[2] = "Tú puedes mostrar cualquier la cantidad de líneas que quieras.";
phrase[3] = "Te deseo suerte!... Bye";
var n=1; // phrase the script is currently displaying
var i=phrase[n].length; // length of 'phrase[n]' to display
var slideDirection = -1; // dirección del desplazamiento. 1=derecha, -1=Izquierda.
function slide() {
var pause=100;
if (n<=numLines) {
i += slideDirection;
window.status=phrase[n].substring(i,phrase[n].length);
if (i==0 || i==phrase[n].length) {
slideDirection = -slideDirection;
if (i==0) {
pause=phrase[n].length*100;
}
if (i==phrase[n].length) {
n++;
if (n>numLines) {
i=0;
pause=100;
}
else {
i=phrase[n].length;
pause=1000;
}
}
}
setTimeout("slide()",pause);
}
else {
if (repeat) {
n=1;
i=phrase[n].length;
setTimeout("slide()",1000);
}
}
}
//-->
</SCRIPT>
<BODY OnLoad="slide()">
<br><br>
</body>
</html>