title: jQuery stop (window).scrollTop function
body: <p>I have an if else statement where it adds a class if the scroll is over 50px. Is there a way I can cancel out this entire function if I were to click a button?</p>
  
  <pre><code>$(window).scroll(function(){
      if($(window).scrollTop()&gt;50){
          $('.scroller').addClass('fixedposition');
      } else {
          $('.scroller').removeClass('fixedposition');
      }
  });
  </code></pre>
  
  <p>I have that same .scroller class on multiple places on the page so I would like to turn it off in certain events.</p>
  
  <p>Example <a href="http://jsfiddle.net/BSXCz/3/" rel="nofollow">JSFiddle</a></p>