title: Javascript CSS modifier triggers too early but only when run locally
body: <p>This is my code: <a href="http://jsfiddle.net/spadez/9sLGe/" rel="nofollow">http://jsfiddle.net/spadez/9sLGe/</a></p>
  
  <p>It works perfectly on JSfiddle. When I run this code locally it doesn't work the same way, what happens is the second I move down the page slider, by the smallest amount, it instantly changes the yellow navbar to position fixed, rather than doing it when it is about to be scrolled off the page.</p>
  
  <pre><code>var init = $('#select').offset().top;
  $(window).scroll(function () {
      if ($(window).scrollTop() &gt; init) {
          $('#select').css({
              top: 0,
              position: 'fixed'
          });
      } else {
          $('#select').css('position', 'relative');
      }
  });
  </code></pre>
  
  <p>Is it obvious why this might be happening? There are no errors in the javascript console.</p>