Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/05/2007, 12:35
Avatar de demiurgo_daemon
demiurgo_daemon
 
Fecha de Ingreso: diciembre-2006
Ubicación: Querétaro
Mensajes: 184
Antigüedad: 17 años, 5 meses
Puntos: 2
Re: ayuda por favor urgente

Hola,

disculpa, pero me tomé la libertad de reacomodar un poco el código:

Código:
var thespeed=4
var myspeed=0

function scrollwindow(){
	holaFrame=document.getElementById("holaFrame")
	holaFrame.window.scrollBy(myspeed,0)
}

function initializeIT(){
	if (myspeed!=0){
		scrollwindow()
	}
}

window.onload = funcition(){
	setInterval("initializeIT()",20)
	fArriba = document.getElementById("flechasUp")
	fArriba.onmouseover = function(){ myspeed=-thespeed; }
	fAbajo = document.getElementById("flechasDown")
	fAbajo.onmouseover = function(){ myspeed=thespeed; }
}
Código HTML:
<div class="flechasUp" id="flechasUp" title="Subir"></div>
<iframe id="holaFrame" src="incluir/frame2.php" noresize scrolling="no" hspace="0" vspace="0" frameborder="0" marginheight="0" marginwidth="0" width="400" height="70" target="_blank"></iframe>
<div class="flechasDown" id="flechasDown" title="Bajar"></div> 
encontré lo siguiente:
  1. necesitas el evento window.onload porque, como lo estabas haciendo, los elementos "holaFrame", etc., no existen al momento de llamar al setInterval
  2. acomodé un poco para que llamaras al resto de los eventos en onload y limpiar un poco el HTML
  3. confundiste los parámetros del scrollBy: cambiaste la x por y

saludos