hi all,
i do have a table with many lines.
I want to use the down key and the up key to navigate in the table.
In fact, as i have many lines in the table, i have done a table in a table, so that a scroll bar apears on the right.
The problem is that when i press the down (or up) key, the line changes, but the scroll bar too, so that my selectd lines is no more visible ...
is there an option that removes the scroll bar moves by pressing a key ? i mean, the scroll bar should only be used with the mouse.
here is the code (and you can see the result at : (just test the table, the rest is not working because there's no IIS server behind this template))
<TABLE ID='list' ALIGN='left' VALIGN='top' WIDTH='100%' CELLSPACING='0' onkeydown='return list_onkeydown()'>
<TR CLASS='LIST_ROWS' OnClick='Change_Sel("1"
;'>
[more code]
</tr>
<TR CLASS='LIST_ROWS' OnClick='Change_Sel("2"
;'>
[more code]
</tr>
</table>
function list_onkeydown() {
switch(window.event.keyCode) {
case 38:
if(CurRow>0) Change_Sel(CurRow-1);
break;
case 40:
if(CurRow<list.rows.length-1 Change_Sel(CurRow+1);
break;
}
}
function Change_Sel(nRow) {
nbRow = list.rows.length;
for(i=0; i<nbRow; i++) {
list.rows.item(i).className = "LIST_ROWS";
}
list.rows.item(nRow).className = "LIST_ROW_SEL";
CurRow = nRow;
}
thanks for have a least reading me ! s-)
sorry again for my bad english
Best regards,
Elise
i do have a table with many lines.
I want to use the down key and the up key to navigate in the table.
In fact, as i have many lines in the table, i have done a table in a table, so that a scroll bar apears on the right.
The problem is that when i press the down (or up) key, the line changes, but the scroll bar too, so that my selectd lines is no more visible ...
is there an option that removes the scroll bar moves by pressing a key ? i mean, the scroll bar should only be used with the mouse.
here is the code (and you can see the result at : (just test the table, the rest is not working because there's no IIS server behind this template))
<TABLE ID='list' ALIGN='left' VALIGN='top' WIDTH='100%' CELLSPACING='0' onkeydown='return list_onkeydown()'>
<TR CLASS='LIST_ROWS' OnClick='Change_Sel("1"
[more code]
</tr>
<TR CLASS='LIST_ROWS' OnClick='Change_Sel("2"
[more code]
</tr>
</table>
function list_onkeydown() {
switch(window.event.keyCode) {
case 38:
if(CurRow>0) Change_Sel(CurRow-1);
break;
case 40:
if(CurRow<list.rows.length-1 Change_Sel(CurRow+1);
break;
}
}
function Change_Sel(nRow) {
nbRow = list.rows.length;
for(i=0; i<nbRow; i++) {
list.rows.item(i).className = "LIST_ROWS";
}
list.rows.item(nRow).className = "LIST_ROW_SEL";
CurRow = nRow;
}
thanks for have a least reading me ! s-)
sorry again for my bad english
Best regards,
Elise