<ul>
<li>пункт 1</li>
<li>пункт 2</li>
<li>пункт 3</li>
<li>пункт 4</li>
</ul>
li
{
cursor:pointer;
font-size:126%;
text-align:left;
width:99%;
border-radius: 5px;
padding:2%;
margin:2%;
border: 1px solid rgb(200,200,250);
}
li:hover
{
background: rgb(100,200,150);
}
var $menu = $('.menu'),
$items = $menu.find('li'),
num = $items.length,
current = -1;
$(document).on('keyup', function (e) {
var key = e.which;
switch (key) {
case 38:
current--;
if (current < 0) {
current = num - 1;
}
break;
case 40:
current++;
if (current > num - 1) {
current = 0;
}
break;
};
$items.eq(current).addClass('active').siblings().removeClass('active');
});