I have this code
$(document.body).onkeyup = function(e) {
var code = e.keyCode;
if(code === 74) {
window.scrollTo(document.body.scrollLeft,
document.body.scrollTop + 200);
}
};
that allows me to scroll a page up and down with the keyboard. The problem is that I have to click on the page I want to scroll to activate this function.
Is there a way to activate immediately without the mouse click?
Thanks.