<form name="form1">
<input type="checkbox" name="chkClk" >click で表示
<textarea name="ta0" rows="5" cols="20" value=""
onScroll="scroll()" onClick="clickTa()"></textarea>
<textarea name="ta1" rows="5" cols="20" value=""></textarea>
</form>
● JavaScript program
//.............................
function clickTa() {
//.............................
if(df1.chkClk.checked) scroll();
}
//.............................
function scroll() {
//.............................
var ta = df1.ta0;
var sh = ta.scrollHeight - ta.offsetHeight;
ista = Math.round((N-5)*ta.scrollTop/sh);
iend = ista + 5;
df1.ta1.value = "";
for(var i=ista; i<iend; i++) {
if(i == N) break;
df1.ta1.value += i;
if(i < iend-1) df1.ta1.value += "\n";
}
}