title: Stop spacebar from scrolling page
body: <p>I know that <code>e.preventDefault();</code> is supposed to stop the spacebar from scrolling on the page, but it is not working on my function</p>
  
  <pre><code>$("html").live("keyup", function (e) {
      var code = (e.keyCode ? e.keyCode : e.which);
      if ((code == 32 || code == 13) &amp;&amp; $("span").is(":focus")) {
          openDropdown();
          $(".dropdown a.PivotItem:first").focus();
          e.preventDefault();
      } else if ((code == 32 || code == 13) &amp;&amp; $("a.PivotItem").is(":focus")) {
          closeDropdown();
          changeSelected($("*:focus"));
          e.preventDefault();
      } else if (code == 27 &amp;&amp; ($("span").is(":focus") || $(".dropdown a.PivotItem").is(":focus"))) {
          closeDropdown();
          $("span").focus();
      } else {
          //do nothing
      }
  });
  </code></pre>
  
  <p>Does it have something to do with the <code>.live(</code> handler I have included?</p>