Ver Mensaje Individual
  #12 (permalink)  
Antiguo 30/01/2006, 17:39
Avatar de tunait
tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
..continuación
Código:
var det = false
function escribe(){
	document.writeln ('<div id="mami">')
	document.write ('<div id="uno" style="top: ' + alto + 'px;">')
	document.write ('<h3 class="titular">')
	document.write (noticias[0].titular)
	document.write ('</h3>')
	document.write ('<span class="fecha">')
	document.write (noticias[0].fecha)
	document.write ('</span>')
	document.write ('<p class="texto">')
	document.write (noticias[0].texto)
	document.write ('</p>')
	if(masInfo == true){
	document.write ('<a class="enlace" href="')
	document.write (noticias[0].enlace)
	document.write ('" target="' + destino + '">más información...</a>')
	}
	document.write ('</div>')
	document.write ('<div id="dos" style="top: ' + (alto + (alto/2)) + 'px;">')
	document.write ('<h3 class="titular">')
	document.write (noticias[1].titular)
	document.write ('</h3>')
	document.write ('<span class="fecha">')
	document.write (noticias[1].fecha)
	document.write ('</span>')
	document.write ('<p class="texto">')
	document.write (noticias[1].texto)
	document.write ('</p>')
	if(masInfo == true){
	document.write ('<a class="enlace" href="')
	document.write (noticias[1].enlace)
	document.write ('" target = "' + destino + '">más información...</a>')
	}
	document.write ('</div>')
	document.write ('<div id="tres" style="top: ' + alto*2 + 'px;">')
	document.write ('<h3 class="titular">')
	document.write (noticias[2].titular)
	document.write ('</h3>')
	document.write ('<span class="fecha">')
	document.write (noticias[2].fecha)
	document.write ('</span>')
	document.write ('<p class="texto">')
	document.write (noticias[2].texto)
	document.write ('</p>')
	if(masInfo == true){
	document.write ('<a class="enlace" href="')
	document.write (noticias[2].enlace)
	document.write ('" target = "' + destino + '">más información...</a>')
	}
	document.write ('</div>')
	document.write ('</div>')
	if(navigator.appName == "Netscape")
	{altoUno = document.getElementById('uno').offsetHeight}
	else{
		altoUno = document.getElementById('uno').clientHeight}
		document.getElementById('uno').onmouseover =function(){
		det = true
		clearTimeout(tiempo)
	}
	document.getElementById('uno').onmouseout =function(){
	det = false;
	clearTimeout(tiempo)
	escrolea()
	}
	
	document.getElementById('dos').onmouseover =function(){
	det = true
	clearTimeout(tiempo)
	}
	document.getElementById('dos').onmouseout =function(){
	det = false;
	clearTimeout(tiempo)
	escrolea()
	}
	document.getElementById('tres').onmouseover =function(){
	det = true
	clearTimeout(tiempo)
	}
	document.getElementById('tres').onmouseout =function(){
	det = false;
	clearTimeout(tiempo)
	escrolea()
	}
}
desp = 1
var cont = 2
var pos,pos2,pos3
pepe = 0
function escrolea(){
	pos = document.getElementById('uno').style.top
	pos = pos.replace(/px/,"");
	pos = pos.replace(/pt/,"");
	pos = new Number(pos);
	pos2 = document.getElementById('dos').style.top
	pos2 = pos2.replace(/px/,"");
	pos2 = pos2.replace(/pt/,"");
	pos2 = new Number(pos2);
	pos3 = document.getElementById('tres').style.top
	pos3 = pos3.replace(/px/,"");
	pos3 = pos3.replace(/pt/,"");
	pos3 = new Number(pos3);
	pos -= desp
	pos2 -= desp
	pos3 -= desp

	if (pos == desp){
		var contenidos = ""
		document.getElementById('tres').style.top = alto + "px"
		document.getElementById('tres').childNodes[0].firstChild.nodeValue = noticias[cont].titular
		if(poneFecha == true){
			document.getElementById('tres').childNodes[1].firstChild.nodeValue = noticias[cont].fecha
		}
		document.getElementById('tres').childNodes[2].firstChild.nodeValue = noticias[cont].texto
		if(masInfo == true){
			document.getElementById('tres').childNodes[3].href = noticias[cont].enlace 
		}
		document.getElementById('uno').style.top = 0 + "px"
		if(cont == noticias.length-1){
			cont=0
		}
		else{
			cont++
		}
		pausa()
		return false
	}
	else{
		if (pos2 == desp){
			var contenidos = ""
			document.getElementById('uno').style.top = alto + "px"
			document.getElementById('uno').childNodes[0].firstChild.nodeValue = noticias[cont].titular
			if(poneFecha == true){
				document.getElementById('uno').childNodes[1].firstChild.nodeValue = noticias[cont].fecha
			}
			document.getElementById('uno').childNodes[2].firstChild.nodeValue = noticias[cont].texto
			if(masInfo == true){
				document.getElementById('uno').childNodes[3].href = noticias[cont].enlace
			}
			document.getElementById('dos').style.top = 0 + "px"
			if(cont == noticias.length-1){
				cont=0
			}
			else{
				cont++
			}
			pausa()
			return false
		}
	else{
			if (pos3 == desp){
				var contenidos = ""
				document.getElementById('dos').style.top = alto + "px"
				document.getElementById('dos').childNodes[0].firstChild.nodeValue = noticias[cont].titular
				if(poneFecha == true){
					document.getElementById('dos').childNodes[1].firstChild.nodeValue = noticias[cont].fecha
				}
				document.getElementById('dos').childNodes[2].firstChild.nodeValue = noticias[cont].texto
				if(masInfo == true){
					document.getElementById('dos').childNodes[3].href = noticias[cont].enlace
				}
				document.getElementById('tres').style.top = 0 + "px"
				if(cont == noticias.length-1){
					cont=0
				}
				else{
					cont++
				}
				pausa()
				return false
		}
		else{
			document.getElementById('uno').style.top = pos + "px"
			document.getElementById('dos').style.top = pos2 + "px"
			document.getElementById('tres').style.top = pos3 + "px"
			}
		}
	}
	tiempo = window.setTimeout('escrolea()',50)
}
var tiempo
function pausa()
{
clearTimeout(tiempo)
if (det == false){
tiempo = setTimeout ('continuar()',2000)
}
}
function continuar()
{
if(det == false)
{escrolea()}
}

document.writeln('<style type="text/css">')
document.writeln ('#mami {')
document.writeln ('position: relative;')
document.writeln ('border: ' + marco + 'px solid ' + colormarco + ';')
document.writeln ('text-align: left;')
document.writeln ('padding: 0px 2px 0px 2px;')
document.writeln ('height: ' + alto + 'px;')
document.writeln ('width: ' + ancho + 'px;')
document.writeln ('overflow: hidden;')
document.writeln ('}')
document.writeln ('#uno {')
document.writeln ('color: #006699;')
document.writeln ('height: ' + (alto/2) + 'px;')
document.writeln ('top: ' + alto + 'px;')
if(cursor == "pointer" || cursor == "hand"){
cursor = (navigator.appName == "Netscape")?'pointer;':'hand;';
}
document.writeln ('cursor:' + cursor + ";")
document.writeln ('position:absolute;}')
document.writeln ('#dos {')
document.writeln ('color: #006699;')
document.writeln ('height: ' + (alto/2) + 'px;')
document.writeln ('top: ' + (alto + (alto/2)) + 'px;')
document.writeln ('cursor:' + cursor + ";")
document.writeln ('position:absolute;}')
document.writeln ('#tres {')
document.writeln ('color: #006699;')
document.writeln ('height: ' + (alto/2) + 'px;')
document.writeln ('top: ' + (alto*2) + 'px;')
document.writeln ('cursor:' + cursor + ";")
document.writeln ('position:absolute;}')
document.writeln ('.titular{')
document.writeln ('margin-bottom: 1px;')
document.writeln ('color:' + colTitular +'; ')
document.writeln ('font-family:' + fuente + ';')
document.writeln ('font-size :' + tamTitular + 'px;font-weight:bold}')
document.writeln ('.texto{')
document.writeln ('margin: 1px;')
document.writeln ('color:' + colTexto + ';')
document.writeln ('font-family:' + fuente + ';')
document.writeln ('font-size:' + tamTexto + 'px;}')
if(poneFecha == true){
document.writeln ('.fecha{')
document.writeln ('margin: 1px;')
document.writeln ('color:' + colFecha +';')
document.writeln ('font-family:' + fuente + ';')
document.writeln ('font-size :' + tamFecha + 'px;font-weight:bold}')
}
else{
document.writeln ('.fecha{display: none;}')
}
document.writeln ('.enlace{')
document.writeln ('margin: 1px;')
document.writeln ('color:' + colEnlace + ';')
document.writeln ('font-family:' + fuente + ';')
document.writeln ('display: block;')
document.writeln ('text-align: right;')
document.writeln ('font-size:' + tamEnlace + 'px;}')
document.writeln ('</style>')
</script>