Prova questo (bisogna mantenere il click sui pulsanti)
codice:
<HTML>
<HEAD>
<TITLE>Selezione da una lista digitando i caratteri in un TextBox</TITLE>
<style type="text/css">
<!--
.inverted {color:white;background-color:navy}
-->
</style>
<SCRIPT>
<!--
//var previousCell = null;
var stopScrollLeft=true;
var stopScrollRight=true;
var aliasContainer = null;
var aliasTable = null;
var scrollStep= 2;
function pippo() {
if (aliasContainer == null || aliasTable == null) {
// return;
} // if (aliasContainer == null || aliasTable == null)
if (! stopScrollLeft) {
document.getElementById('t').value = aliasContainer.scrollLeft;
ScrollLeft();
} // if (! stopScrollLeft)
if (! stopScrollRight) {
document.getElementById('t').value = aliasContainer.scrollLeft;
ScrollRight();
} // if (! stopScrollRight)
} // function pippo()
window.setInterval("pippo()",15);
function ScrollLeft() {
if (aliasContainer.scrollLeft > 0) {
aliasContainer.scrollLeft -= scrollStep;
} else {
aliasContainer.scrollLeft = 0;
return;
} // if (aliasContainer.scrollTop > 0)
} // function ScrollLeft()
function ScrollRight() {
if (aliasContainer.scrollLeft <= aliasTable.offsetWidth - aliasContainer.offsetWidth) {
aliasContainer.scrollLeft+= scrollStep;
} // if (aliasContainer.scrollLeft <= aTable.offsetWidth - aliasContainer.offsetWidth)
} // function ScrollRight()
function stopScroll() {
stop = true;
} // function stopScroll()
function setScrollObjects(aContainer,aTable) {
aliasContainer = aContainer;
aliasTable = aTable;
} // function setScrollObjects(aContainer,aTable)
//-->
</SCRIPT>
</HEAD>
<BODY id="body" BGCOLOR="#ffffff">
<DIV ID="a" STYLE="height:50px; width:300;z-index=100;font-family:verdana;font-size:3pt;overflow: hidden;">
<TABLE ID="b" NAME="stati" BORDER="0">
<TR>
<TD width="1000" NOWRAP>Aaaaaaaaaaa ddddddd eeeeeeeeee rrrrrrrrrr ttttttttt ddddddddddddddvd dddddddd dddddddddddssssssss s s j jjjjjjjjji </TD>
</TR>
</TABLE>
</div>
<input type="button" id="upa" value="Up" onmousedown="if (event.button==1) {stopScrollLeft=false;setScrollObjects(document.getElementById('a'),document.getElementById('b'));}" onmouseup="stopScrollLeft=true;setScrollObjects(null,null);">
<input type="button" id="downa" value="Down" onmousedown="if (event.button==1) {stopScrollRight=false;setScrollObjects(document.getElementById('a'),document.getElementById('b'));}" onmouseup="stopScrollRight=true;setScrollObjects(null,null);">
<input type="text" id="t">
</BODY>
</HTML>