title: debug lag of calculate margin top for Position fixed sidebar scrolling to bottom
body: <p>I want to fix left sidebar on the responsive view.</p>
  
  <p>I use Margin top (dependency with scroll position) for wrapper of sidebar!
  that's work! but on the some browser it's slow motion  (example: macbook pro retina 15" 2014 chrome Version 42)</p>
  
  <p><a href="http://jsfiddle.net/hp3bn5yy/1/" rel="nofollow">jsfiddle</a></p>
  
  <pre><code> jQuery(function($){
      var target = $('#fixed_sidebar .fixed');
      var sidebarPosition = $(target).offset().top;
  
      function calculatesidebar(){
          var  heightWindow = $(window).height();
          var scrollPosition = $(document).scrollTop();
          var sidebarHeight = target.outerHeight();
          var positionOftarget = (sidebarPosition + sidebarHeight) - heightWindow;
          var targetMargin =  parseInt(target.css('marginTop'));
  
  
          if (scrollPosition &gt;= positionOftarget){
              var margin = scrollPosition - positionOftarget;
              target.css('marginTop', margin+'px');
  
          }else{
              target.css('marginTop', '0');
          }
  
      }
  
      $( window ).scroll(function(){
          calculatesidebar();
      });
      $( window ).resize(function() {
          calculatesidebar();
      });
  
  });
  </code></pre>