Apothem
04-09-2009, 06:23 AM
$(window).keydown(function(e){
if( e.keyCode == 9 ) { // 9 = Tab
$('*').animate({scrollTop: ($(window).scrollTop() + 500)+'px'}, 1000);
return false;
}
});
Every time I press my tab button, it would do the event BUT it would stick to its position and refrain from moving. In other words, I click tab. It would move the page down by 500 pixels. I try to scroll down, but I can't (I'm using FF 3.0.8)
What's wrong?
ALSO when I click the tab button, the tab is still activated even after I returned false. What's wrong with that as well?
if( e.keyCode == 9 ) { // 9 = Tab
$('*').animate({scrollTop: ($(window).scrollTop() + 500)+'px'}, 1000);
return false;
}
});
Every time I press my tab button, it would do the event BUT it would stick to its position and refrain from moving. In other words, I click tab. It would move the page down by 500 pixels. I try to scroll down, but I can't (I'm using FF 3.0.8)
What's wrong?
ALSO when I click the tab button, the tab is still activated even after I returned false. What's wrong with that as well?