title: jQuery - make sticky footer stop at the top of footer and become sticky again on scroll up
body: <p>I have a form that is sticky on every page, and I need it to stop being sticky when it reaches the top of the footer. I have this working properly, but I need it to become sticky again when scrolling back up the page. Anything glaringly wrong?</p>
  
  <pre><code>$(window).scroll(function(){
       var footerTopPos = $('#footer-wrapper').offset().top;
       var navBottomPos = $('#footer-form-wrapper').offset().top;
       if(navBottomPos &gt;= footerTopPos) {
           $('#footer-form-wrapper').addClass('sticky');
       } else {
           $('#footer-form-wrapper').removeClass('sticky');
       } 
   });
  </code></pre>
  
  <p>To clarify, the first part works perfectly. The css changes from "fixed" to "absolute" and the form stays in place. The problem is, I want it to revert back to "fixed" when you start scrolling back up the page (my else statement). This part does nothing at all. </p>
  
  <p>Here is a rough jsfiddle to show the issue <a href="http://jsfiddle.net/L693f5bg/14/" rel="nofollow">http://jsfiddle.net/L693f5bg/14/</a></p>