problema iframe scrollable

LostCore

Nuovo Utente
24 Apr 2005
2
0
0
Ciao a tutti ^^
Dunque, io ho due iframe:

Codice:
<iframe id="newstable" src="news_genpage.php" width=150 height=150 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>

e

Codice:
<iframe id="prjtable" src="news_prjpage.php" width=150 height=150 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>

Poi ho due collegamenti cosù fatti:

Codice:
	  <div id="news" class="pagetext2bold">
	  	<a href="#" onMouseover="scrollspeed=-2" onMouseout="scrollspeed=0, iframe=0">Up</a>
	    :: General News ::
		<a href="#" onMouseover="scrollspeed=2" onMouseout="scrollspeed=0, iframe=0">Down</a>
	    </div>
	  
	  <div id="projects" class="pagetextbold2">
	  <a href="#" onMouseover="scrollspeed=-2" onMouseout="zcrollspeed=0, iframe=0">Up</a> 
	  :: Projects News ::
	  <a href="#" onMouseover="scrollspeed=2" onMouseout="scrollspeed=0, iframe=0">Down</a> 
	  </div>

Nelle rispettive pagine incluse nei due iframe ho questo codice:

Codice:
<script language="JavaScript1.2">

//Scrollable content III- By http://www.dynamicdrive.com

var speed 
var currentpos=curpos1=0
var alt=1
var curpos2=-1

function initialize(){
if (window.parent.scrollspeed!=0){
speed=window.parent.scrollspeed
scrollwindow()
}
}

function scrollwindow(){
temp=(document.all)? document.body.scrollTop : window.pageYOffset
alt=(alt==0)? 1 : 0
if (alt==0)
curpos1=temp
else
curpos2=temp

window.scrollBy(0,speed)
}

setInterval("initialize()",10)

</script>

Il problema è che posizionando il cursore su qualsiasi Up e Down vengono scrollati entrambi gli iframe.

Ho provato a cambiare il nome alla variabile scrollspeed in uno dei due div con il risultato che uno iframe scrolla e l'altro resta fermo.

Come posso fare?

Grazie mille.
 

Discussioni simili