Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/08/2005, 04:07
Avatar de susaninhax
susaninhax
 
Fecha de Ingreso: noviembre-2004
Mensajes: 358
Antigüedad: 19 años, 5 meses
Puntos: 3
insertar url en un ascensor de noticias

Buenas apañeros, necesito insertar una url en un ascensor de noticias que a continuación os pego. El problema es que en vez de aparecerme cuando pasas por enzima la url, abajo del explorador, me aparece lo siguiente:" http://anfbk.com/principal/www.gestionafacil.com " es decir en vez de aparecerme la url www.gestionafacil.com me aparece la pagina en la que estoy terminada en la pagina que corresponde. No se si me he esplicado bien pero les dejo el codigo akí por si a alguien le suena o lo comprende y me puede decir como meter el enlace o solucionar el problema, es muy importante, porfabor!!!! necesito vuestra ayuda.

Código HTML:
<script language="JavaScript" type="text/JavaScript">

var ancho = 330 //anchura del cuadro
var alto =65 //altura del cuadro
var marco = 0 //0 para que notenga marco (borde)
var fondo = '' //color de fondo del cuadro
var pausilla = 2000 //tiempo de la pausa en milisegundos (2000 = 2 segundos)
var destino = "_blank" //target en donde se quiera que se carguen los enlaces, en caso de usarlos.
var cursor = "default;"  //cursor que se quiera sobre el cuadro
var colTitular = '#FF1B21' //color del texto del titular
var colTexto = '#00004C' // color del texto de la noticia
var colFecha = '#3399FF' //color del texto de la fecha
var colEnlace = '#003322' //color del texto del enlace
var fuente = "verdana" //fuente para los textos 
var tamTitular = '14' //tamaño de la fuente del titular
var tamTexto = '12' //tamaño de la fuente del texto de la noticia
var tamFecha = '12' // tamaño de la fuente de la fecha
var tamEnlace = '10' // tamaño de la fuente del enlace 
var masInfo = true //Determina si se usa o no el enlace. true para usarlo. false para omitirlo
var poneFecha = true //true para poner fecha. false para omitirla. Si no se quiere fecha, dejar las comillas vacías ""

function noticia(titular,texto,fecha,enlace,destino)
	{
	this.titular = titular
	this.texto = texto
	this.fecha= fecha
	this.enlace = enlace
	this.destino = destino
	}
var noticias = new Array()

<?php // akí hago la consulta para ir sacando las noticias
$result_temario=mysql_query("select 
ID_NOTICIA, TITULO, NOTICIA, FECHA_MYSQL, URL
from ASCENSOR
order by TITULO", $link) or die (mysql_error()); 

$n=0;

while ($row=mysql_fetch_array($result_temario)) {

$id_noticia=$row["ID_NOTICIA"];
$titulo=$row["TITULO"];
$noticia=$row["NOTICIA"];
$fecha_mysql=$row["FECHA_MYSQL"];
$fecha=explode("-", "$fecha_mysql");
$dia=$fecha[2];
$mes=$fecha[1];
$year=$fecha[0];
$url=$row["URL"];
?>

noticias[<?php echo $n; ?>]= new noticia("<?php echo $titulo; ?>","<?php echo $noticia; ?>","<?php echo $dia."-".$mes."-".$year; ?>","<?php echo $url; ?>","_blank")  // $url contiene el enlace de www.gestionafacil.com

<?php
$n++;
}
?>
var det = false
function escribe(){
document.write ('<div id="mami" style="width:' + ancho + '; height:' + alto + 'px; position:relative;  overflow:hidden ">')
document.write('<table bgcolor="' + fondo + '" border = "' + marco + '" width="' + ancho + '" height="100%"><tr><td valign="top">')
document.write ('<div id="uno" style="top:' + alto +'; width:' + ancho + ' height:' + alto + 'px;  ">')
document.write ('<div class="titular">')
document.write (noticias[0].titular)
document.write ('</div>')
document.write ('<div class="fecha">')
document.write (noticias[0].fecha)
document.write ('</div>')
document.write ('<span class="texto">')
document.write (noticias[0].texto)
document.write ('</span>')
if(masInfo == true){
	document.write ('<a class="enlace" href="')
	document.write (noticias[0].enlace)
	document.write ('" target="' + destino + '"><?php echo $url; ?></a>')
	}
document.write ('</div>')
document.write ('<div id="dos" style="top:' + (alto*2) +'; width:' + ancho + ' height:' + alto + 'px; ">')
document.write ('<div class="titular">')
document.write (noticias[1].titular)
document.write ('</div>')
document.write ('<div class="fecha">')
document.write (noticias[1].fecha)
document.write ('</div>')
document.write ('<span class="texto">')
document.write (noticias[1].texto)
document.write ('</span>')
if(masInfo == true){
	document.write ('<a class="enlace" href="')
	document.write (noticias[1].enlace)
	document.write ('" target = "' + destino + '"><?php echo $url; ?></a>')
	}
document.write ('</div>')
document.write('</td></tr></table>')
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()
	 
	}
}
desp = 1
var cont = 1
var pos,pos2
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);
pos -= desp
pos2 -= desp

if (pos == desp){
	var contenidos = ""
	document.getElementById('dos').style.top = alto
	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('uno').style.top = 0
	if(cont == noticias.length-1)
		{cont=0}
	else{
		cont++
		}
	pausa()
	return false
	}
else{
	if (pos2 == desp){
		var contenidos = ""
		document.getElementById('uno').style.top = alto
		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
		if(cont == noticias.length-1)
		{cont=0}
	else{
		cont++
		}
		pausa()
		return false
		}
	else{
		document.getElementById('uno').style.top = pos
		document.getElementById('dos').style.top = pos2
		}
	}
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.write('<style type="text/css">')
document.write ('#uno {')
document.write ('color: #006699;')
if(cursor == "pointer" || cursor == "hand"){
cursor = (navigator.appName == "Netscape")?'pointer;':'hand;';
}
document.write ('cursor:' + cursor + ";")
document.write ('position:absolute;}')
document.write ('#dos {')
document.write ('color: #006699;')
document.write ('cursor:' + cursor + ";")
document.write ('position:absolute;}')
document.write ('.titular{')
document.write ('color:' + colTitular +';')
document.write ('font-family:' + fuente + ';')
document.write ('font-size :' + tamTitular + ';font-weight:bold}')
document.write ('.texto{')
document.write ('color:' + colTexto + ';')
document.write ('font-family:' + fuente + ';')
document.write ('font-size:' + tamTexto + ';}')
if(poneFecha == true){
document.write ('.fecha{')
document.write ('color:' + colFecha +';')
document.write ('font-family:' + fuente + ';')
document.write ('font-size :' + tamFecha + ';font-weight:bold}')
}
else{
document.write ('.fecha{display: none;}')
}
document.write ('.enlace{')
document.write ('color:' + colEnlace + ';')
document.write ('font-family:' + fuente + ';')
document.write ('font-size:' + tamEnlace + ';}')
document.write ('</style>')
</script>
<body onload="escrolea()">
<div align="center">
  <p>
    <script>escribe()</script>
  </p>
    </div>
</body> 
pues eso, el ascensor funciona de fabula pero eso no se como solucionarlo. Pero os lo agradecería muchísimo una ayudita , llevo ya un monton de tiempo y no lo doi conseguido y estoy que me tiro de los pelos!!!!! Muchísimas gracias de antemano!!!