Ciao a tutti,

sto impazzendo su uno script Js che ho trovato in giro che si occupa di fare lo scrolling verticale di una tabella che dinamicamente creo con una query php.
Con IE la colonna scrorre per l'intera sua lunghezza. Con firefox appena la testa della colonna raggiunge il margine superiore del layer ricomincia dall'inizio. Mi sono reso conto che tale problema accade quando la colonna dinamica è più lunga dello spazio "di scorrimento".
Ecco dove vedere in concreto http://www.borgonovello.com/site/din...ovascroll3.php
Di seguito trovate lo script:

<?
function trunc($phrase, $max_words, $terminal_string){
$phrase_array = explode(' ',$phrase);
if(count($phrase_array) > $max_words && $max_words > 0)
$phrase = implode(' ',array_slice($phrase_array, 0, $max_words)) . $terminal_string;
return $phrase;
}


include('xxx.php');
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd");
mysql_select_db ("borgonovello_com", $link)
or die ("Non riesco a selezionare il db $database
");
$query = mysql_query("SELECT * FROM investimenti order by data_ins desc")or
die(mysql_error());
?>
<!-- STEP I: Goes between <HEAD> & </HEAD> tags
You may keep it, change or ignore it!
Or linking to an External Style Sheet:
<LINK REL=StyleSheet HREF="yourstyle.css">
without other style tags -->
<!-- STEP II: Goes between <HEAD> & </HEAD> tags
Or linking to an External js file:
<script language="javascript" src="yourfile.js"></script>
without other script tags -->
<link href="../css.css" rel="stylesheet" type="text/css" />
<SCRIPT LANGUAGE="JavaScript">

/***********************************
* http://javascripts.vbarsan.com/
* This notice may not be removed
***********************************/

//-- Begin Scroller's Parameters and message -->
//scroller width: change to your own;
var swidth=195;

//scroller height: change to your own;
var sheight=1000;

//background color: change to your own;
var sbcolor="#ffffff";

//scroller's speed: change to your own;
var sspeed=2;
var restart=sspeed;
rspeed=sspeed;
//text: change to your own
wholemessage='<table border=0 align="left" width="190"><? while($results = mysql_fetch_array($query)) { $percorso="/usr/local/psa/home/vhosts/borgonovello.com/httpdocs/site/dinamic/upload/".$results['cod_prog']."_small.jpg"; $ran=md5(microtime()); if(file_exists($percorso)) { $img="<img src=upload/".$results['cod_prog']."_small.jpg?".$ran." width=80 align=left hspace=1 vspace=1 border=0>"; }else { $img="<img src=http://www.borgonovello.com/site/dinamic/zoom.jpg width=80 align=left hspace=1 vspace=1 border=0 >"; } ?><tr bgcolor="#FFFFFF"><td height="30" class="scroll"><a href="http://www.borgonovello.com/site/main2.php?cosa=detta_invest&step=2&codice=<? echo $results['cod']; ?>&lang=<? echo $_GET['lang']; ?> " class="scroll" target="_parent"><? echo $img; echo "<div align=justify> Prezzo: ".$results['prezzo']." Rendita: ".$results['rendita']." Ubicazione: ".$results['ubicazione']." ".$results['superficie']."</div>"; }?></table>';
//Or you may do a slide show running up any number of images too!
//Preload is recommended (no downloading check) - otherwise you may skip this:
//preload1 = new Image();
//preload1.src = "http://...";
//preload2 = new Image();
//preload2.src = "http://...";
//preload3 = new Image();
//preload3.src = "http://...";
// ...

//if no preloading, replace below '+ preload... +' with the actual Images path "..."

//wholemessage='[img]+preload1.src+[/img]
'+
//'[img]+preload2.src+[/img]
'+
//'[img]+preload3.src+[/img]
'+
//'<img ... >';

//-- end Parameters and message -->

//-- begin: Scroller's Algorithm -->
function goup(){if(sspeed!=rspeed*8){sspeed=sspeed*2;restar t=sspeed;}}
function godown(){if(sspeed>rspeed){sspeed=sspeed/2;restart=sspeed;}}
function start(){if(document.getElementById)ns6marquee(docu ment.getElementById('slider'));else if(document.all)iemarquee(slider);else if(document.layers)ns4marquee(document.slider1.doc ument.slider2);}function iemarquee(whichdiv){iediv=eval(whichdiv);iediv.sty le.pixelTop=sheight+"px";iediv.innerHTML=wholemess age;sizeup=iediv.offsetHeight;ieslide();}function ieslide(){if(iediv.style.pixelTop>=sizeup*(-1)){iediv.style.pixelTop-=sspeed+"px";setTimeout("ieslide()",100);}else{ied iv.style.pixelTop=sheight+"px";ieslide();}}functio n ns4marquee(whichlayer){ns4layer=eval(whichlayer);n s4layer.top=sheight;ns4layer.document.write(wholem essage);ns4layer.document.close();sizeup=ns4layer. document.height;ns4slide();}function ns4slide(){if(ns4layer.top>=sizeup*(-1)){ns4layer.top-=sspeed;setTimeout("ns4slide()",100);}else{ns4laye r.top=sheight;ns4slide();}}function ns6marquee(whichdiv){ns6div=eval(whichdiv);ns6div. style.top=sheight+"px";ns6div.innerHTML=wholemessa ge;sizeup=ns6div.offsetHeight;ns6slide();}function ns6slide(){if(parseInt(ns6div.style.top)>=sizeup*(-1)){ns6div.style.top=parseInt(ns6div.style.top)-sspeed+"px";setTimeout("ns6slide()",100);}else{ns6 div.style.top=sheight+"px";ns6slide();}}
//-- end Algorithm -->
</script>

</head>

<body onLoad="start();">
<!-- STEP IV: Goes between <BODY ... > & </BODY> tags
begin: body code -->

<script language="JavaScript">document.write('<table border="0" align="center"><tr><td width='+swidth+'px>');if (document.getElementById || document.all){document.write('<span style="height:'+sheight+'px;"><div style="position:relative;overflow:hidden;width:'+s width+'px;height:'+sheight+'px;clip:rect(0 '+swidth+'px '+sheight+'px 0);background-color:'+sbcolor+';" onMouseover="sspeed=0;" onMouseout="sspeed=restart"><div id="slider" style="position:relative;width:'+swidth+'px;"></div></div></span>')}</script>
<ilayer width=&{swidth}; height=&{sheight}; name="slider1" bgcolor=&{sbcolor};><layer name="slider2" width=&{swidth}; onMouseover="sspeed=0;" onMouseout="sspeed=restart"></layer></ilayer>



Spero riusciate ad aiutarmi..

Grazie,

Emanuele