Menu
Hi,
I am creating a Javascript web-app that will (hopefully) use the arrow keys to control some of the actions. The problem I’m running into is that when the up or down arrow keys are pressed, the page scrolls.
I tried using the code below to stop the scrolling…
function cancelEvent(e)
{
e = e ? e : window.event;
if(e.stopPropagation)
e.stopPropagation();
if(e.preventDefault)
e.preventDefault();
e.cancelBubble = true;
e.cancel = true;
e.returnValue = false;
return false;
}
but it didn’t work. Any ideas? Suggestions? I appreciate your time and help.