Ejemplos en Javascript

Letrero con efecto "Ping pong"

Este script permite insertar en la barra inferior de tu navegador un letrero con un efecto tipo "Ping pong".

<HTML>
<HEAD>

<TITLE>Ejemplos Javascript: ejemplo pr???¡ctico </TITLE>

<script language="JavaScript">


<!--


/* MjM'S JAVA CODENAME = PINGPONG


   This JavaScript Code was written by MjM for Hyperchat UK

   I am not responsible for any damage caused by my code.

   This code can be modified as long as the Author's Name is still attached.


   Email : MjM@hyperchat.co.uk


   ????© Copyright 1996


*/

var yourwords = "* Mensaje aqu???­... bla bla bla bla*";


var buffer1="                        ";


var buffer2="                        ";


var message1=buffer1+yourwords+buffer2;


var dir = "left";


var speed = 75;


function pingpong()

{


if (dir == "left")


  {


    message2=message1.substring(2,message1.length)+"  ";


    window.status=message2;

    setTimeout("pingpong();",speed);


    message1=message2;


    if (message1.substring(0,1) == "*") dir="right";


  }


else


  {


    message2="  "+message1.substring(0,message1.length-2);


    window.status=message2;


    setTimeout("pingpong();",speed);


    message1=message2;



    if (message1.substring(message1.length-1,message1.length) == "*") dir="left";


  }


}


// -->

</script>


</HEAD>

<BODY bgcolor="white" onload="pingpong();">





</body>
</html>

Barra de estado