title: Jquery window scroll. call just one time
body: <p>Hi I have one question about jquery window scroll function. I have code somthing like this.</p>
  
  <pre><code>$(window).scroll(function(){
          if($(window).scrollTop() &gt; $(".pages").offset().top) {
              $('.top-slider').slick('slickPause');
          }else {
              $('.top-slider').slick('slickPlay');
          }
      });
  </code></pre>
  
  <p>Ok every time when you scroll if first is true it call every 1px scrolled window. Is that way to call just one time if true but check on scroll if other is true call that just one time?</p>
  
  <p>Thanks for your answers :) </p>