¿Cómo puedo poner un texto dinámico en una página web que estoy diseñando?
Hola te queria hacer una pregunta sobre una duda que tengo para una página web.Quiero poner un texto dinamico(creo que se llama asi) que sube en un recuado, se para ahi un momentito, sube otra vez para arroiba desapareciendo y vuelve a aparecer otra cosa distinta desde abajo y asi rotando con varios mensajes, es pera poner una especie de seccion de noticias, gracias por tu tiempo espero que me puedas ayudar
Joseda
Joseda
Respuesta de kornerson
1
1
Mi respuesta va a ser la que doy a todo el mundo que quiere hacer estas cosas...
Para hacerlo descargaros el dreamweaver de macromedia. Permite trabajar con capas de manerta intuitiva y el codigo que genera es valido para todos los navegadores. Lo tienes en www.macromedia.com
Para hacerlo descargaros el dreamweaver de macromedia. Permite trabajar con capas de manerta intuitiva y el codigo que genera es valido para todos los navegadores. Lo tienes en www.macromedia.com
Veamos... te voy a explicar como lo tienes que hacer con DW, ¿ok?
Vale...
Puedo hacer una cosa, mandarte el codigo generado que es lo que voy a hacer y tu lo estudias, ¿vale? Es mas rapido para mi. Un saludo.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
//Copyright 1997 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (numGotos != null)
if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
jmpFwd = (fNew > tmLn.curFrame);
for (i = 0; i < tmLn.length; i++) {
sprite = (jmpFwd)? tmLn : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
if (sprite.charAt(0) == "s") {
numKeyFr = sprite.keyFrames.length;
firstKeyFr = sprite.keyFrames[0];
lastKeyFr = sprite.keyFrames[numKeyFr - 1];
if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
if (sprite.obj != null) {
if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
else sprite.obj[props.prop2][props.prop] = props[propNum];
} }
} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
}
tmLn.curFrame = fNew;
if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}
function MM_timelinePlay(tmLnName, myID) { //v1.2
//Copyright 1997 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
if (myID == tmLn.ID) { //if Im newest
setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
fNew = ++tmLn.curFrame;
for (i=0; i<tmLn.length; i++) {
sprite = tmLn;
if (sprite.charAt(0) == 's') {
if (sprite.obj) {
numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
keyFrm=1;
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr != props.length) {
if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
else sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
} else {
while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
else sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
} } } } }
} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
if (fNew > tmLn.lastFrame) tmLn.ID = 0;
} }
}
function MM_initTimelines() { //v4.0
//MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
var ns = navigator.appName == "Netscape";
var ns4 = (ns && parseInt(navigator.appVersion) == 4);
var ns5 = (ns && parseInt(navigator.appVersion) > 4);
document.MM_Time = new Array(1);
document.MM_Time[0] = new Array(2);
document.MM_Time["Timeline1"] = document.MM_Time[0];
document.MM_Time[0].MM_Name = "Timeline1";
document.MM_Time[0].fps = 15;
document.MM_Time[0][0] = new String("sprite");
document.MM_Time[0][0].slot = 1;
if (ns4)
document.MM_Time[0][0].obj = document["Layer1"] ? document["Layer1"].document["noticias"] : document["noticias"];
else if (ns5)
document.MM_Time[0][0].obj = document.getElementById("noticias");
else
document.MM_Time[0][0].obj = document.all ? document.all["noticias"] : null;
document.MM_Time[0][0].keyFrames = new Array(1, 20, 38, 50);
document.MM_Time[0][0].values = new Array(5);
if (ns5)
document.MM_Time[0][0].values[0] = new Array("0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px");
else
document.MM_Time[0][0].values[0] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
document.MM_Time[0][0].values[0].prop = "left";
if (ns5)
document.MM_Time[0][0].values[1] = new Array("0px", "-6px", "-12px", "-18px", "-24px", "-30px", "-36px", "-42px", "-49px", "-54px", "-60px", "-65px", "-70px", "-75px", "-79px", "-83px", "-87px", "-91px", "-94px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-102px", "-107px", "-114px", "-120px", "-128px", "-136px", "-145px", "-154px", "-164px", "-173px", "-183px", "-192px");
else
document.MM_Time[0][0].values[1] = new Array(0,-6,-12,-18,-24,-30,-36,-42,-49,-54,-60,-65,-70,-75,-79,-83,-87,-91,-94,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-102,-107,-114,-120,-128,-136,-145,-154,-164,-173,-183,-192);
document.MM_Time[0][0].values[1].prop = "top";
if (!ns4) {
document.MM_Time[0][0].values[0].prop2 = "style";
document.MM_Time[0][0].values[1].prop2 = "style";
}
if (ns5)
document.MM_Time[0][0].values[2] = new Array("300px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "300px");
else
document.MM_Time[0][0].values[2] = new Array(300,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,300);
document.MM_Time[0][0].values[2].prop = "height";
if (!ns4)
document.MM_Time[0][0].values[2].prop2 = "style";
document.MM_Time[0][0].values[3] = new Array("visible","inherit","inherit","inherit");
document.MM_Time[0][0].values[3].prop = "visibility";
if (!ns4)
document.MM_Time[0][0].values[3].prop2 = "style";
document.MM_Time[0][0].values[4] = new Array("3","2","2","2");
document.MM_Time[0][0].values[4].prop = "zIndex";
if (!ns4)
document.MM_Time[0][0].values[4].prop2 = "style";
document.MM_Time[0][1] = new String("behavior");
document.MM_Time[0][1].frame = 51;
document.MM_Time[0][1].value = "MM_timelineGoto('Timeline1','1')";
document.MM_Time[0].lastFrame = 51;
for (i=0; i<document.MM_Time.length; i++) {
document.MM_Time.ID = null;
document.MM_Time.curFrame = 0;
document.MM_Time.delay = 1000/document.MM_Time.fps;
}
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" onLoad="MM_timelinePlay('Timeline1')">
<div id="Layer1" style="position:absolute; left:354px; top:114px; width:174px; height:90px; z-index:2; clip: rect(0 174 90 0); visibility: visible">
<div id="noticias" style="position:absolute; left:0px; top:0px; width:174px; height:300px; z-index:3; visibility: visible">
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">las noticias
van aqui las noticias van aqui las noticias van aqui las noticias van aqui
las noticias van aqui las noticias van aqui las noticias van aqui las noticias
van aqui </font><br>
<br>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">las noticias
van aqui las noticias van aqui las noticias van aqui las noticias van aqui
las noticias van aqui las noticias van aqui las noticias van aqui las noticias
van aqui </font><br>
<br>
<br>
</p>
</div>
</div>
El layer 1 es el marco que esconde la capa grande.
</body>
</html>
ATENCION:
Para entender su funcionamiento te recomiendo que te mires la ayuda y el curso (que vienen por defecto con el dreamweaver) de los Timelines. Es lo que se utiliza para hacer este tipo de cosas. Prefiero orientar a la gente a hacerles su trabajo, asi aprenden de verdad. Espero que no te importe. Juega con el codigo que te hemandado, e intenta comprender cada parte de los objetos que lo componen. Y mira todo lo que se puede hacer con los timelines y las capas.
Vale...
Puedo hacer una cosa, mandarte el codigo generado que es lo que voy a hacer y tu lo estudias, ¿vale? Es mas rapido para mi. Un saludo.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
//Copyright 1997 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (numGotos != null)
if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
jmpFwd = (fNew > tmLn.curFrame);
for (i = 0; i < tmLn.length; i++) {
sprite = (jmpFwd)? tmLn : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
if (sprite.charAt(0) == "s") {
numKeyFr = sprite.keyFrames.length;
firstKeyFr = sprite.keyFrames[0];
lastKeyFr = sprite.keyFrames[numKeyFr - 1];
if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
if (sprite.obj != null) {
if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
else sprite.obj[props.prop2][props.prop] = props[propNum];
} }
} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
}
tmLn.curFrame = fNew;
if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}
function MM_timelinePlay(tmLnName, myID) { //v1.2
//Copyright 1997 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
if (myID == tmLn.ID) { //if Im newest
setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
fNew = ++tmLn.curFrame;
for (i=0; i<tmLn.length; i++) {
sprite = tmLn;
if (sprite.charAt(0) == 's') {
if (sprite.obj) {
numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
keyFrm=1;
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr != props.length) {
if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
else sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
} else {
while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
else sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
} } } } }
} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
if (fNew > tmLn.lastFrame) tmLn.ID = 0;
} }
}
function MM_initTimelines() { //v4.0
//MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
var ns = navigator.appName == "Netscape";
var ns4 = (ns && parseInt(navigator.appVersion) == 4);
var ns5 = (ns && parseInt(navigator.appVersion) > 4);
document.MM_Time = new Array(1);
document.MM_Time[0] = new Array(2);
document.MM_Time["Timeline1"] = document.MM_Time[0];
document.MM_Time[0].MM_Name = "Timeline1";
document.MM_Time[0].fps = 15;
document.MM_Time[0][0] = new String("sprite");
document.MM_Time[0][0].slot = 1;
if (ns4)
document.MM_Time[0][0].obj = document["Layer1"] ? document["Layer1"].document["noticias"] : document["noticias"];
else if (ns5)
document.MM_Time[0][0].obj = document.getElementById("noticias");
else
document.MM_Time[0][0].obj = document.all ? document.all["noticias"] : null;
document.MM_Time[0][0].keyFrames = new Array(1, 20, 38, 50);
document.MM_Time[0][0].values = new Array(5);
if (ns5)
document.MM_Time[0][0].values[0] = new Array("0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px");
else
document.MM_Time[0][0].values[0] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
document.MM_Time[0][0].values[0].prop = "left";
if (ns5)
document.MM_Time[0][0].values[1] = new Array("0px", "-6px", "-12px", "-18px", "-24px", "-30px", "-36px", "-42px", "-49px", "-54px", "-60px", "-65px", "-70px", "-75px", "-79px", "-83px", "-87px", "-91px", "-94px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-97px", "-102px", "-107px", "-114px", "-120px", "-128px", "-136px", "-145px", "-154px", "-164px", "-173px", "-183px", "-192px");
else
document.MM_Time[0][0].values[1] = new Array(0,-6,-12,-18,-24,-30,-36,-42,-49,-54,-60,-65,-70,-75,-79,-83,-87,-91,-94,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-97,-102,-107,-114,-120,-128,-136,-145,-154,-164,-173,-183,-192);
document.MM_Time[0][0].values[1].prop = "top";
if (!ns4) {
document.MM_Time[0][0].values[0].prop2 = "style";
document.MM_Time[0][0].values[1].prop2 = "style";
}
if (ns5)
document.MM_Time[0][0].values[2] = new Array("300px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "299px", "300px");
else
document.MM_Time[0][0].values[2] = new Array(300,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,300);
document.MM_Time[0][0].values[2].prop = "height";
if (!ns4)
document.MM_Time[0][0].values[2].prop2 = "style";
document.MM_Time[0][0].values[3] = new Array("visible","inherit","inherit","inherit");
document.MM_Time[0][0].values[3].prop = "visibility";
if (!ns4)
document.MM_Time[0][0].values[3].prop2 = "style";
document.MM_Time[0][0].values[4] = new Array("3","2","2","2");
document.MM_Time[0][0].values[4].prop = "zIndex";
if (!ns4)
document.MM_Time[0][0].values[4].prop2 = "style";
document.MM_Time[0][1] = new String("behavior");
document.MM_Time[0][1].frame = 51;
document.MM_Time[0][1].value = "MM_timelineGoto('Timeline1','1')";
document.MM_Time[0].lastFrame = 51;
for (i=0; i<document.MM_Time.length; i++) {
document.MM_Time.ID = null;
document.MM_Time.curFrame = 0;
document.MM_Time.delay = 1000/document.MM_Time.fps;
}
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" onLoad="MM_timelinePlay('Timeline1')">
<div id="Layer1" style="position:absolute; left:354px; top:114px; width:174px; height:90px; z-index:2; clip: rect(0 174 90 0); visibility: visible">
<div id="noticias" style="position:absolute; left:0px; top:0px; width:174px; height:300px; z-index:3; visibility: visible">
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">las noticias
van aqui las noticias van aqui las noticias van aqui las noticias van aqui
las noticias van aqui las noticias van aqui las noticias van aqui las noticias
van aqui </font><br>
<br>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">las noticias
van aqui las noticias van aqui las noticias van aqui las noticias van aqui
las noticias van aqui las noticias van aqui las noticias van aqui las noticias
van aqui </font><br>
<br>
<br>
</p>
</div>
</div>
El layer 1 es el marco que esconde la capa grande.
</body>
</html>
ATENCION:
Para entender su funcionamiento te recomiendo que te mires la ayuda y el curso (que vienen por defecto con el dreamweaver) de los Timelines. Es lo que se utiliza para hacer este tipo de cosas. Prefiero orientar a la gente a hacerles su trabajo, asi aprenden de verdad. Espero que no te importe. Juega con el codigo que te hemandado, e intenta comprender cada parte de los objetos que lo componen. Y mira todo lo que se puede hacer con los timelines y las capas.
- Compartir respuesta
- Anónimo
ahora mismo