Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/01/2002, 12:31
bet
 
Fecha de Ingreso: febrero-2001
Mensajes: 292
Antigüedad: 17 años, 9 meses
Puntos: 0
Re: ¿cómo puedo hacer un texto marquee en netscape?

El código que va a continuación funciona tanto en NS como en IE.
Copialo dentro del body:
<pre>
&lt;script language=&quot;JavaScript1.2&quot;&gt;

/*
Cross browser marquee script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/


//Specify the marquee's width (in pixels)
var marqueewidth=330
//Specify the marquee's height (in pixels, pertains only to NS)
var marqueeheight=20
//Specify the marquee's scroll speed (larger is faster)
var speed=6
//Specify the marquee contents
var marqueecontents='&lt;font face=&quot;Arial&quot;&gt;&lt;strong&gt;&lt;big&gt ;Thank you for visiting &lt;a href=&quot;http://dynamicdrive.com&quot;&gt;Dynamic Drive.&lt;/a&gt; If you find this script useful, please consider linking to us by &lt;a href=&quot;../link.htm&quot;&gt;click here.&lt;/a&gt; Enjoy your stay!&lt;/big&gt;&lt;/strong&gt;&lt;/font&gt;'

if (document.all)
document.write('&lt;marquee scrollAmount='+speed+' style=&quot;width:'+marqueewidth+'&quot;&gt;'+marq ueecontents+'&lt;/marquee&gt;')

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout(&quot;window.onresize=regenerate&quot;, 450)
intializemarquee()
}
}

function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.w rite('&lt;nobr&gt;'+marqueecontents+'&lt;/nobr&gt;')
document.cmarquee01.document.cmarquee02.document.c lose()
thelength=document.cmarquee01.document.cmarquee02. document.width
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.left&gt;= thelength*(-1)){
document.cmarquee01.document.cmarquee02.left-=speed
setTimeout(&quot;scrollit()&quot;,100)
}
else{
document.cmarquee01.document.cmarquee02.left=marqu eewidth
scrollit()
}
}

window.onload=regenerate2
&lt;/script&gt;


&lt;ilayer width=&amp;{marqueewidth}; height=&amp;{marqueeheight}; name=&quot;cmarquee01&quot;&gt;
&lt;layer name=&quot;cmarquee02&quot;&gt;&lt;/layer&gt;
&lt;/ilayer&gt;
</pre>

<hr noshade size=1 color="#000000"><img src="http://www.gograph.com/Images-8712/ClipArt/cat03.gif" height="50" border=0 align="absmiddle"> <font size="2" face="verdana" color="#000000">bet[/CODE]