Está usted en Indice > Construcción > Lenguajes > JavaScript > Lecciones y Paso a Paso > Frases en diagonal con javascript.
Construcción
Maletín
Utilidades
Cursos
Promoción
Rentabilidad
Zona Novatos
Foros
Acceso a tu cuenta

Frases en diagonal con javascript.

Para mostrar una frase en la parte izquierda superior de la página en diagonal que cambia de texto cada x segundos solo necesitas seguir estos pasos.

1)Incluye este codigo entre las etiquetas <head></head>, y modifica el texto de message[0]="AQUI VA UNA FRASE" poniendo el texto que quieras dentro de las comillas.

<SCRIPT language=JavaScript>
<!-- Beginning of JavaScript -

if (document.layers) {
alert("Explorer seulement")
}
var message = new Array()
message[0]="AQUI VA UNA FRASE"
message[1]="UN SEGUNDO TEXTO AQUI"
message[2]="PUEDES CONTINUAR"
message[3]="INSERTANDO MAS FRASES"
message[4]="SON ILIMITADAS"
message[5]="SI UTILIZAS ESTE SCRIPT"
message[6]="NO OLVIDES"
message[7]="PONER UN LINK"
message[8]="A PERST.COM"
message[9]="EN TU WEB"
message[10]="TE LO AGRADECERIAMOS MUCHO"
message[11]="GRACIAS POR TU VISITA"
message[12]="VUELVE A VISITARNOS"
message[13]="MUCHAS GRACIAS"

var i_message=0

var scrollerheight=250
var scrollerwidth=400

var startheight=0

var font_size=25
var font_family="Times"

var timer

function initiate() {
document.all.rotationstyle.style.posLeft=-(Math.floor(scrollerwidth/2))+font_size
document.all.rotationstyle.style.posTop=startheight
startscroll()
}

function startscroll() {
if (document.all) {
do_rotate="yes"
rotationstyle.filters[0].apply()
rotationstyle.innerHTML=
'<OBJECT ID="rotationobj" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+
'<PARAM NAME="Line0001" VALUE="SetLineStyle(0)">'+
'<PARAM NAME="Line0002" VALUE="SetLineColor(0,0,0)">'+
'<PARAM NAME="Line0003" VALUE="SetFillColor(0,0,0)">'+
'<PARAM NAME="Line0004" VALUE="SetFont(''+font_family+'', '+font_size+', 400, 0, 0, 0)">'+
'<PARAM NAME="Line0005" VALUE="Text(''+message[i_message]+'', 0, 0, 0)">'+
'</OBJECT>'
rotationstyle.filters[0].play()
rotationobj.Rotate(0,0,-45)

i_message++
if (i_message>=message.length) {i_message=0}
timer=setTimeout("startscroll()",4000)
}
}

function stopscroll() {
do_rotate="no"
}

// - End of JavaScript - -->
</SCRIPT>

2)Y entre los tags <body> y </body> incluye este otro codigo:

<SPAN id=rotationstyle
style="FILTER: revealTrans(Transition=3, Duration=2); LEFT: -2000px; POSITION: absolute">
<OBJECT classid=CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6
id=rotationobj></OBJECT></SPAN>
onload=initiate()

Y listo!!




Autor: Dudli and Peter Gehrig
http://www.mundojavascript.com/

Usuarios que han visto este tema también han visto...

- La sombra se mueve en Javascript
- Prueba ultima modificación
- Información del Navegador en JavaScript
- Abrir ventana sin bordes
- Clicks en 20 segundos en Javascript


Versión imprimible - Versión imprimible de este documento
Enviar e-mail - Enviar por e-mail este documento
Publicidad

Información legal | Política de Privacidad | Contacte con nosotros

Otro proyecto de Factoría de Internet. Copyright© 2003-2008 Factoría de Internet S.L.. Todos los derechos reservados.


Página generada el 14-10-2008 a las 00:16:14