Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable a scroll bar

Status
Not open for further replies.

tyris

Programmer
Nov 2, 2000
311
0
0
FR
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(&quot;1&quot;);'>
[more code]
</tr>
<TR CLASS='LIST_ROWS' OnClick='Change_Sel(&quot;2&quot;);'>
[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 = &quot;LIST_ROWS&quot;;
}
list.rows.item(nRow).className = &quot;LIST_ROW_SEL&quot;;
CurRow = nRow;

}


thanks for have a least reading me ! s-)
sorry again for my bad english

Best regards,
Elise
 
Note sure if this is what you are looking for but here it is. Add the Scroll=0 to the <BODY> tag.

<body scroll=0>

This will disable the scrollbar in the current document. There may be other ways to to it but this is the easiest.

 
Correction to my previous post. It is <body scroll=&quot;no&quot;> if you use &quot;0&quot; it won't work, sorry about that.
 
well that's not what i was looking for .. i need to disable a scrool bar in a table containing a table in fact ..
never mind, thanks for taking time to have answerd to me

s-) Best regards,
Elise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top