Foros del Web » Programando para Internet » Javascript »

script para texto

Estas en el tema de script para texto en el foro de Javascript en Foros del Web. Sabeis de algún script para realizar un efecto a un texto, para que vaya apareciendo poco a poco de abajo a arriba. El texto estaria ...
  #1 (permalink)  
Antiguo 25/08/2003, 17:24
Avatar de FLECHA  
Fecha de Ingreso: mayo-2003
Ubicación: Mi casa
Mensajes: 409
Antigüedad: 21 años
Puntos: 1
script para texto

Sabeis de algún script para realizar un efecto a un texto, para que vaya apareciendo poco a poco de abajo a arriba.

El texto estaria dentro de una tabla

Gracias de antemano
  #2 (permalink)  
Antiguo 25/08/2003, 19:37
Avatar de mifune  
Fecha de Ingreso: junio-2003
Ubicación: BCNeta
Mensajes: 466
Antigüedad: 20 años, 10 meses
Puntos: 0
Saludos FLECHA

Supongo que te refieres a un scroll de texto, pues mira, aquí te dejo tres enlaces donde encontrarás montones de scripts, entre ellos unos cuantos para hacer lo que quieres. No te pongo ninguno en concreto porque es mejor que busques el que más te interese.

http://simplythebest.net/info/dhtml_scripts.html
http://dynamicdrive.com/
http://www.dhtmlcentral.com/


  #3 (permalink)  
Antiguo 26/08/2003, 08:55
Avatar de FLECHA  
Fecha de Ingreso: mayo-2003
Ubicación: Mi casa
Mensajes: 409
Antigüedad: 21 años
Puntos: 1
Hola mifune, como siempre tu colaboración es de inestimable ayuda, gracias.

No he encontrado lo que busco, ya que en ingles me defiendo bastante mal, y lo que he encontrado no consigo que camine, necesitaba un script de texto que se desplace de abajo a arriba, y que me permitiera texto ilimitado. Encontre uno que hace aparecer el texto de derecha a izquierda y que me funciona, usare este mientras tanto.
Si tu lo encontraras en algun momento, te agradeceria me lo indicaras.

Siempre agradecido por tus ayudas
  #4 (permalink)  
Antiguo 26/08/2003, 09:10
Avatar de RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 22 años, 2 meses
Puntos: 50
Hola.. aprovechando el link de mifune, encontré el código que creo que estás buscando.. solo haz copy and paste a lo siguiente:
así tal cual funciona

Código PHP:
<html>
<
body>
<!-- 
Start Dynamic scroller -->
<
table width="155" cellspacing="0" border="1" bgcolor="#E1F0F0" bordercolor="#008080" bordercolorlight="#FFFFFF">
        <
tr>
        <
td width="25%" align="center" valign="bottom">
        <
a href="Javascript:scrolldown()"><b><font face="Verdana" size="2">Down</font></b></a>
        </
td>
        <
td width="25%" align="center" valign="bottom">
        <
a href="Javascript:scrollup()"><b><font face="Verdana" size="2">Up</font></b></a>
        </
td>
        <
td width="25%" align="center" valign="bottom">
        <
a href="Javascript:stopall()"><b><font face="Verdana" size="2">Stop</font></b></a>
        </
td>
        <
td width="25%" align="center" valign="bottom">
        <
a href="Javascript:shifttotop()"><b><font face="Verdana" size="2">Top</font></b></a>
        </
td>
        </
tr>    
</
table>
<
script language="JavaScript1.2">
// Author: Ron Grafe [email][email protected][/email] [url]http://www.gdevresources.com/Pages/Scripts/Dynamicscroller/Dynamicscroller.htm[/url]
// Permission granted to SimplytheBest.net to feature script in its
// DHTML script collection at [url]http://simplythebest.net/info/dhtml_scripts.html[/url]
iens6=document.all||document.getElementById
ns4
=document.layers

<!-- Lower is faster -->
var 
scrollspeed 40

<!-- Container setup -->
if (
iens6){
document.write('<div id="container" style="position:relative;width:155;height:160px;overflow:hidden;border:1px ridge white">')
document.write('<div id="content" style="position:absolute;width:155;left:0;top:0">')
}
</script>
<ilayer name="nscontainer" width=155 height=160 clip="0,0,155,160">
<layer name="nscontent" width=155 height=160>

<!--INSERT CONTENT HERE-->
<b><font style="color: black" size="1" type="times" face="Arial"><br>
 </font><font type="times" size="2" style="color: black" face="Arial"> SimplytheBest.net</font></b><font type="times" size="2" style="color:black"><br><hr size="1" color="#008080">
</font>
<table><tr>
<td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><a href="http://simplythebest.net/shareware.html" onmouseover="stopall()"><font face="Verdana" size="1" type="times">Shareware
 & Freeware</font></a></td></tr>
<tr><td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/scripts/dhtml_scripts.html" onmouseover="stopall()">DHTML
  Scripts & Javascripts</a></font></td></tr>
<tr><td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/cgiscripts/cgiscripts.html" onmouseover="stopall()">CGI
  Scripts</a></font></td></tr>
 <tr>
  <td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/info/" onmouseover="stopall()">Information
   library</a></font></td>
 </tr>
 <tr>




  <td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/drivers/drivers.html" onmouseover="stopall()">Device
   drivers</a></font></td>
 </tr>
 <tr>
  <td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/fonts/" onmouseover="stopall()">Free
   Fonts</a></font></td>
 </tr>
 <tr>
  <td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/affiliates/" onmouseover="stopall()">Affiliate
   programs</a></font></td>
 </tr>
 <tr>
  <td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/hosting/" onmouseover="stopall()">Hosting
   providers</a></font></td>
 </tr>
 <tr>
  <td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/music/" onmouseover="stopall()">Music
   directory</a></font></td>
 </tr>
 <tr>
  <td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/shop/" onmouseover="stopall()">Shopping
   directory</a></font></td>
 </tr>
<tr><td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://simplythebest.net/search/search.html" onmouseover="stopall()">Metasearch</a></font></td></tr>
</table><font type="times" size="2" style="color:black"><br>
  <font face="Arial"><b>PlanMagic.com</b></font><br><hr size="1" color="#008080">
</font>
<table><tr>
<td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://planmagic.com/business_plan.html" onmouseover="stopall()">PlanMagic
 Business</a><br>
 professional business plan software</font></td></tr>
<tr><td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://planmagic.com/marketing_planning.html" onmouseover="stopall()">PlanMagic
  Marketing</a><br>
  professional marketing plan software</font></td></tr>
 <tr>
  <td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://planmagic.com/finance.html" onmouseover="stopall()">PlanMagic
   Finance Pro</a><br>
   financial calculations were never this easy</font></td>
 </tr>
 <tr>
  <td valign="top"><font face="Verdana" size="1" type="times" style="color: black">•</font></td><td><font face="Verdana" size="1" type="times"><a href="http://planmagic.com/webquest.html" onmouseover="stopall()">PlanMagic
   WebQuestPro</a><br>
   complete web marketing plan generator</font></td>
 </tr>
</table><font type="times" size="2" style="color:black"><br>
</font>
<!--END CONTENT-->
</layer></ilayer>

<script language="JavaScript1.2">
// Author: Ron Grafe [email][email protected][/email] [url]http://www.gdevresources.com/Pages/Scripts/Dynamicscroller/Dynamicscroller.htm[/url]
// Permission granted to SimplytheBest.net to feature script in its
// DHTML script collection at [url]http://simplythebest.net/info/dhtml_scripts.html[/url]
var step=1
if (iens6){
    document.write('</div></div>')
    var contentobj=document.getElementById? document.getElementById("content") : document.all.content
    var contentheight=contentobj.offsetHeight
    if (document.getElementById&&!document.all){
           step=5
    }
}
else if(ns4){
    var contentobj=document.nscontainer.document.nscontent
    var contentheight=contentobj.clip.height
}
<!-- scroll down function -->
function scrolldown() {
    if(window.scrolltimerup){
        clearTimeout(scrolltimerup)
    }
    if(iens6&&parseInt(contentobj.style.top)>=(contentheight*(-1)+100)){
        contentobj.style.top=parseInt(contentobj.style.top)-step
    }else if(ns4&&contentobj.top>=(contentheight*(-1)+100)){
        contentobj.top-=step
    }
    scrolltimerdown = setTimeout("scrolldown()",scrollspeed)
}
<!-- scroll up function -->
function scrollup() {
    if(window.scrolltimerdown){
        clearTimeout(scrolltimerdown)
    }
    if(iens6&&parseInt(contentobj.style.top)<=0){
        contentobj.style.top=parseInt(contentobj.style.top)+step
    }else if(ns4&&contentobj.top<=0){ 
        contentobj.top+=step
    }
    scrolltimerup = setTimeout("scrollup()",scrollspeed)    
}
<!-- function to stop all scroll timers -->
function stopall() {
    
if(window.scrolltimerup){
        clearTimeout(scrolltimerup)
    }
    if(window.scrolltimerdown){
        clearTimeout(scrolltimerdown)
    }
}
<!-- function that shifts the object to top -->
function shifttotop(){
    stopall()
    if (iens6) {
        contentobj.style.top=0
    }else{
        contentobj.top=0
    }
}

function getcontent_height(){
    if (iens6)
    contentheight=contentobj.offsetHeight
}
window.onload=getcontent_height

</script>
<!-- End of Dynamic scroller -->
</body>
</html> 
Saludos
__________________
Nadie roba nada ya que en la vida todo se paga . . .

Exentrit - Soluciones SharePoint & Net
  #5 (permalink)  
Antiguo 26/08/2003, 11:30
Avatar de FLECHA  
Fecha de Ingreso: mayo-2003
Ubicación: Mi casa
Mensajes: 409
Antigüedad: 21 años
Puntos: 1
Gracias Rotk (un amigo más)

Me puede servir, pero no es lo que busco ya que con este script el usuario tiene que pulsar para que el texto se desplace, yo queria uno que se desplace desde el momento que cargue la pagina y una vez salga todo el texto se detenga.

usaré uno de los dos si alguien no lo remedia.

Muchas gracias nuevamente
  #6 (permalink)  
Antiguo 26/08/2003, 17:55
Avatar de mifune  
Fecha de Ingreso: junio-2003
Ubicación: BCNeta
Mensajes: 466
Antigüedad: 20 años, 10 meses
Puntos: 0
A ver si este te sirve:

<html>
<head>
<script language="JavaScript">
/*
Thomas Brattli
*/
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
function checkBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new checkBrowser()

lstart=100
loop=true
// Velocidad
speed=40
pr_step=1

function makeObj(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.el=bw.dom?document.getElementById(obj):bw.ie4 ?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
this.css=bw.dom?document.getElementById(obj).style :bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
this.scrollHeight=bw.ns4?this.css.document.height: this.el.offsetHeight
this.newsScroll=newsScroll;
this.moveIt=b_moveIt; this.x; this.y;
this.obj = obj + "Object"
eval(this.obj + "=this")
return this
}
function b_moveIt(x,y){
this.x=x;this.y=y
this.css.left=this.x
this.css.top=this.y
}
function newsScroll(speed){
if(this.y>-this.scrollHeight){
this.moveIt(0,this.y-pr_step)
setTimeout(this.obj+".newsScroll("+speed+")",speed )
}else if(loop) {
this.moveIt(0,lstart)
eval(this.obj+".newsScroll("+speed+")")
}
}
function newsScrollInit(){
oNewsCont=new makeObj('divNewsCont')
oNewsScroll=new makeObj('divNewsText','divNewsCont')
oNewsScroll.moveIt(0,lstart)
oNewsCont.css.visibility='visible'
oNewsScroll.newsScroll(speed)
}
onload=newsScrollInit;
</script>
<style>
#divNewsCont{
background-color: #330066;
height: 120px;
width: 120px;
overflow: hidden;
visibility: hidden;
position: absolute;
border: 1px solid #FFCC00;

}
#divNewsText{
margin-right: 3px;
margin-left: 5px;
position: relative;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #FFFFFF;
}
</style>
</head>
<body onLoad="newsScrollInit();">
<div id="divNewsCont">
<div id="divNewsText"> <b><u>PARRAFO UNO</u>:</b>
Sabeis de algún script para realizar un efecto a un texto
para que vaya apareciendo poco a poco de abajo a arriba.
El texto estaria dentro de una tabla.<br>
Gracias de antemano
<p> <b><u>PARRAFO DOS</u>:</b> yo queria uno que
se desplace desde el momento que cargue la pagina
y una vez salga todo el texto se detenga.
<p> <b><u>PARRAFO TRES</u>:</b> usaré uno de los dos
si alguien no lo remedia.<br>
Muchas gracias nuevamente
</div></div>
</body>
</html>

Ahora te toca a ti modificarlo a tu gusto

P.D: la prisa es porque me voy una semanita fuera y ya sabes.....

Saludos.
  #7 (permalink)  
Antiguo 26/08/2003, 18:43
Avatar de FLECHA  
Fecha de Ingreso: mayo-2003
Ubicación: Mi casa
Mensajes: 409
Antigüedad: 21 años
Puntos: 1
pasatelo bien

Bueno que te lo pases bien y que te veamos de vuelta con mas energia que nunca ok.

Probaré tu ayuda y ya nos vemos por aqui.

Que te diviertas chavalote
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 04:16.