jQuery - Adding fixed positioning not working as intended
<p>Having a little trouble with jQuery again, or at least I think...</p>

<p>My client is saying that the categories menu is shifting over to the right, but no matter what browser I'm on, I can't see it happening! </p>

<p>The only way I can reconstruct, is by resizing the widow and scrolling right. </p>

<p>Any thoughts? </p>

<p><strong>EDIT:</strong> Just to confirm, I'm waiting the sidebar to follow the top of the screen once scrolled past... which it seems to be doing on every browser I have looked at. Apart from my clients, as you can see in the screenshot. </p>

<p><img src="http://i.stack.imgur.com/XzogG.png" alt="Screenshot"></p>

<pre><code>#side{
    position: absolute;
}
#side-wrapper { 
  position: absolute;
}
#side.fixed {
  position: fixed;
  top: 0;
}

$(document).ready(function () {  
  var top = $('#side').offset().top - parseFloat($('#side').css('marginTop').replace(/auto/, 0));
  $(window).scroll(function (event) {
    // what the y position of the scroll is
    var y = $(this).scrollTop();

    // whether that's below the form
    if (y &gt;= top) {
      // if so, ad the fixed class
      $('#side').addClass('fixed');
    } else {
      // otherwise remove it
      $('#side').removeClass('fixed');
    }
  });
});
</code></pre>
