Foros del Web » Programando para Internet » Javascript »

Muy bueno

Estas en el tema de Muy bueno en el foro de Javascript en Foros del Web. Hola , que tal , estoy muy agradecido con muchos de estos foros que me han ayudado , por eso lo creo justo colaborar un ...
  #1 (permalink)  
Antiguo 05/11/2003, 18:56
Avatar de Larc  
Fecha de Ingreso: octubre-2003
Ubicación: Mexico
Mensajes: 259
Antigüedad: 20 años, 6 meses
Puntos: 0
De acuerdo Muy bueno

Hola , que tal , estoy muy agradecido con muchos de estos foros que me han ayudado , por eso lo creo justo colaborar un poquito tambien , que les parece este script que simula algo hecho en flash esta muy bueno se los recomiendo.



<!--

******Espero y les sirva y guste al menos a unos cuantos********

-->

<html>
<body bgcolor="#ffffff" scroll="no">

<script>
<!-- // Hide

var isDOM = false, isNS4 = false;
if (document.all) var isDOM = true, docObj = 'document.all.', styObj = '.style';
else if (document.layers) var isNS4 = true, docObj = 'document.', styObj = '';
*****Puedes cambiar las frases por las que mas desees*****
var quotes = new Array(); c = 0;
quotes[c] = 'So Long, And Thanks For All The Fish'; c++;
quotes[c] = 'Yomama so...'; c++;
quotes[c] = 'Nothing lasts forever but the tomato'; c++;
quotes[c] = 'mmmm... chocolaaateahrghlly...'; c++;
quotes[c] = 'Very funny Scotty, now beam down my clothes!'; c++;
quotes[c] = 'Who let the dogs out?'; c++;
quotes[c] = 'Dang it... the boy ain\'t right'; c++;
quotes[c] = 'Shrimp gumbo, shrimp patties, shrimp...'; c++;
quotes[c] = 'Och aye th\' noo!'; c++;
quotes[c] = 'Respect my authoritaah!'; c++;
quotes[c] = 'So cunning you could stick a tail on it and call it a weasel'; c++;
quotes[c] = 'And I\'d say, "Oi! You! NO!"'; c++;
quotes[c] = 'That\'s a one, spicy! meat-a-ball!'; c++;
quotes[c] = 'The world is a vampire...'; c++;
quotes[c] = 'This is the quote that never ends...'; c++;
quotes[c] = 'Screeew you guys, I\'m going home'; c++;
quotes[c] = 'The Earth is full. Go home!'; c++;
quotes[c] = 'So many pedestrians, so little time...'; c++;

var visQuotes = 10; // Maximum onscreen at once.

var sDivSty = new Array(visQuotes);
var sDivRef = new Array(visQuotes);
var speed = new Array(visQuotes);

// Left: Low speed colours (lighter) .... Right: High speed colours (darker).
var colours = new Array('B2C7DE','A4BCD8','96B2D2','88A8CC','7A9EC6' ,'6C94C0','5E89BA');


function checkDivs()
{
for (i = 0; i < visQuotes; i++)
{
// If it's moved offscreen to the left (or starting), set things in motion...
if (parseInt(sDivSty[i].left) < (0 - (isDOM ? sDivRef[i].clientWidth : sDivSty[i].clip.width)))
{
speed[i] = Math.floor(Math.random() * 56) + 8; // Varies: 8 to 63.
// Off to the right it goes.
sDivSty[i].left = (isDOM ? document.body.clientWidth : window.innerWidth) + Math.random() * 50;
// Write a quote in a colour that depends on the speed.

/* Stylesheets - guess which browser has bugs :)
*
* divText = '<nobr><span style="font: ' + speed[i] + 'px Arial, Helvetica; ' +
* 'color: #' + colours[Math.floor(speed[i] / 8) - 1] + '">' +
* quotes[Math.floor(Math.random() * quotes.length)] + '</span></nobr>';
*/

fontSize = Math.floor(speed[i] / 8) - 1;
divText = '<nobr><font face="Arial, Helvetica" size="' + fontSize + '" color="#' +
colours[fontSize] + '">' + quotes[Math.floor(Math.random() * quotes.length)] +
'</font></nobr>';

if (isDOM) sDivRef[i].innerHTML = divText;
if (isNS4)
{
sDivRef[i].document.write(divText);
sDivRef[i].document.close();
}
// Position and layer it according to its speed (faster = higher).
sDivSty[i].zIndex = speed[i];
topMax = (isDOM ? document.body.clientHeight : innerHeight) - speed[i];
sDivSty[i].top = topMax * Math.random();
}
// All items: Keep 'em moving left.
sDivSty[i].left = parseInt(sDivSty[i].left) - (speed[i] / 4);
}
}


function initDivs()
{
for (i = 0; i < visQuotes; i++)
{
divID = 'sDiv' + i.toString();
if (isDOM) document.write('<div id="' + divID + '" style="position: absolute; left: -1000">&nbsp;</div>');
// Have to use layers, divs are buggy as..... in NS. Again.
if (isNS4) document.write('<layer id="' + divID + '" left="-1000">&nbsp;</layer>');
sDivRef[i] = eval(docObj + 'sDiv' + i);
sDivSty[i] = eval(docObj + 'sDiv' + i + styObj);
}

setInterval('checkDivs()', 50);
}

if (isDOM || isNS4) initDivs();

// End Hide -->
</script>

<div id="mainText" style="position: absolute; left: 100; top: 200; z-index: 100">
<h1>'Ello 'ello 'ello what 'ave we 'ere then?</h1>
<div>

</body>
</html>

Si me pasan alguno parecido = y no esta de mas aprender màs, me interesan tambien script para menus...

Enhorabuena
Suerte.....
__________________
Quien parte de las sombras y se levanta como un muerto brillando como una estrella sobre èl (towlen), entre la oscuridad congelante y la luz.
LÄRÇ :serio:
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 01:17.