title: Disable scrolling parent page when playing a game in iframe
body: <p>I have a very simply game page, where I have games in iframes. I want to disable scrolling on the main page when I am playing a game in iframe. I have tried overflow:hidden but it disables totally scrolling, which is useless.</p>
  
  <p>When the page is longer than the screen pressing the down arrow scrolls the page down, and makes the game impossible to play.</p>
  
  <p>Is there a basic way to disable scrolling during playing?</p>
  
  <p>Game input listener:</p>
  
  <pre><code>/*
   This simply library keeps the state of the currently
   pressed keys by using keydown and keyup event handlers.
   */
  (function() {
      var pressedKeys = {};
      function setKey(event, status) {
          var code = event.keyCode;
          var key;
          switch(code) {
          case 32:
              key = 'SPACE'; break;
          case 37:
              key = 'LEFT'; break;
          case 38:
              key = 'UP'; break;
          case 39:
              key = 'RIGHT'; break;
          case 40:
              key = 'DOWN'; break;
          default:
              // Convert ASCII codes to letters
              key = String.fromCharCode(code);
          }
          pressedKeys[key] = status;
      }
      document.addEventListener('keydown', function(e) {
          setKey(e, true);
          e.stoppreventDefault();
      });
  </code></pre>
  
  <p>Thank you for your help!</p>