0

I have a problem with my game website. When the user is playing a Flash game that requires the up and down arrow keys, the page scrolls up and down instead of the object in the game. You can check out this problem through this link to my website http://triceragames.net/diving-dennis/. My website based on Wordpress. The left and right arrows work without any problems.

Jojodmo
  • 23,357
  • 13
  • 65
  • 107
  • Check out Zeta's answer on this related (identical) question: [Disable arrow key scrolling in users browser](http://stackoverflow.com/questions/8916620/disable-arrow-key-scrolling-in-users-browser/8916697#8916697) – Jonny Henly Mar 02 '15 at 09:57

1 Answers1

2

I recommend that you incorporate JavaScript in your application. Insert this code wherever you want in your HTML:

document.onkeydown = function(evt) {
    evt = evt || window.event;
    var keyCode = evt.keyCode;
    if (keyCode >= 37 && keyCode <= 40) {
        return false;
    }
};

Hope this helps.

Rajinikanth
  • 369
  • 1
  • 9