I want to be able to scroll trough an ul list with my keyboard keys. After a couple of attempts i got this working.
unfortunately i face a problem with very long lists. I want to be able to scroll trough them by providing the css rule overflow:auto;
The keyboard input is still evaluated correctly, but the scrollbar isn't scrolling along. Could someone specify how I can find a solution to autoscroll when needed with the keyboard input?
My html:
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
Inch
</a>
<ul class="dropdown-menu">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>11</li>
<li>12</li>
<li>13</li>
<li>14</li>
<li>15</li>
<li>16</li>
<li>17</li>
<li>18</li>
<li>19</li>
</ul>
</div>
My css:
ul{
list-style-type:none;
max-height:110px;
overflow:auto;
text-align:center;
}
.selected{
background:#ff0000;
}
I set up an jsfiddle environment to show my code: