title: Javascript code doesnt work in IE
body: <p>Here is jsfiddle: <a href="http://jsfiddle.net/vZMyS/" rel="nofollow">http://jsfiddle.net/vZMyS/</a>
  EDIT: thanks to Buck Doyle i made an appropriate if else with different versions of the script for chrome and firefox/opera. Now it just doesnt work with IE.</p>
  
  <p>Script is supossed to make user able to scroll down/up to scrollpoints that are specified in the "var scrollKeys", using up/down keyboard keys, it does work in chrome, but it doesnt in other browsers.</p>
  
  <p>Any idea whats wrong here? How could i fix this code in order to make it work in firefox/opera/ie8+?</p>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;div class="big"&gt;
  &lt;div class="box1"&gt;
      &lt;input type="text" name="input1" class="input1" /&gt;
  &lt;/div&gt;
  &lt;div class="box2"&gt;
      &lt;input type="text" name="input2" class="input1" /&gt;
  &lt;/div&gt;
  &lt;div class="box1"&gt;
      &lt;input type="text" name="input3" class="input1" /&gt;
  &lt;/div&gt;
  &lt;div class="box2"&gt;
      &lt;input type="text" name="input4" class="input1" /&gt;
  &lt;/div&gt;
  &lt;/div&gt;​
  </code></pre>
  
  <p><strong>css</strong></p>
  
  <pre><code>.big {width:400px; height:4000px; float:left;}
  .box1 {width:400px; height:1000px; background-color:#ccc; float:left;}
  .box2 {width:400px; height:1000px; background-color:#ddd; float:left;}
  .input1 {width:120px; height:16px; float:left;}
  </code></pre>
  
  <p><strong>javascript</strong></p>
  
  <pre><code>var scrollKeys = new Array('0', '1000', '2000', '3000');
  $('body').on('keyup', function(event) {
      var keypressed = (event.which) ? event.which : event.keyCode;
      var curScroll = $('body').scrollTop();
      var keys = scrollKeys.length;
      var moved = false;
      for (i = 0; i &lt; keys; i++) {
          //console.log(scrollKeys[i]);
          if (moved == false) {
              if (keypressed == 40 &amp;&amp; i != (keys - 1) &amp;&amp; parseInt(scrollKeys[i]) &lt; curScroll &amp;&amp; parseInt(scrollKeys[i + 1]) &gt; curScroll) {
                  $('body').animate({
                      scrollTop : (parseInt(scrollKeys[i + 1]))
                  }, 'fast', function() {});
                  console.log('down');
                  moved = true;
              } else if (keypressed == 38 &amp;&amp; i != 0 &amp;&amp; parseInt(scrollKeys[i]) &gt; curScroll &amp;&amp; parseInt(scrollKeys[i - 1]) &lt; curScroll) {
                  $('body').animate({
                      scrollTop : (parseInt(scrollKeys[i - 1]))
                  }, 'fast', function(){});
                  console.log('up');
                  moved = true;
              }
          }
      }
  });​
  </code></pre>
  
  <p>​</p>