ciao ragazzi avrei bisogno del vostro aiuto!!! ho una tabella con 40 campi text in un div e vorrei calcolare la posizione di ogni elemento(campo text).in pratica quando scrollo la pagina il primo elemento non si troverà più nella stessa posizione ma sarà scrollato,io ho bisogno di sapere la posizione dell'elemento anche quando è scrollato.vi posto il codice aspetto notizie.
<html>
<head>
<title>tabella</title>
<SCRIPT type="text/javascript">
function prova(){
var contenitore=document.getElementById('pippo');
alert(contenitore.scrollTop);
}
function visualizza() {
document.getElementById('ccc').innerHTML=window.op en('www.html.it','prova','width=100,height=90,left =550,top=150');
}
</script>
</head>
<body>
<form name="uno" action="">
<center><div id="pippo" style="width:450px;height:200px; overflow-x:scroll; overflow-y:scroll;border:1px solid black;">
<table cellpadding="4" cellspacing="1" width="120%" border=0>
<tr>
<td width=20% height="40" valign="bottom"><input type="text" onfocus ="visualizza();">
<td width=40% id="ccc" height="40" valign="top"></td>
</td>
</div>
</tr>
<tr>
<td width=20%><input type="text" name="txt" id="txtdue" >
</td>
</tr>
<tr>
<td width=20%><input type="text" name="txtuno">
</td>
</tr>
<tr>
<td width=20%><input type="text" id="txtuno">
</td>
</tr>
</div>
<tr>
<td width=20%><input type="text" name="5">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="6">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="7">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="8">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="9">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="10">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="11">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="12">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="13">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="14">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="15">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="16">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="17">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="18">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="19">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="20">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="21">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="22">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="23">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="24">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="25">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="26">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="27">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="28">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="29">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="30">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="31">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="32">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="33">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="34">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="35">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="36">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="37">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="38">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="39">
</td>
</tr>
<tr>
<td width=20%><input type="text" name="40">
</td>
</tr>
</table>
</center>
</form>
<center>
<form action="">
<input type="button" value="Coordinate" onclick="prova();">
</form>
</div>
</center>
</body>
</html>