title: ScrollTop with button & scroll with JQuery
body: <p>I have a website with two scroll options. When you scroll down, it scrolls to the anchor Point 1.</p>
  
  <p>I also have a Button which jumps to the same anchor point.</p>
  
  <p>My problem: When I click the Button, the site jumps to the Anchor, but because there are two ways to the anchor, it triggers the first scroll option as well. </p>
  
  <pre><code>jQuery(document).ready(function($) {
      var flag = true;
  
      $(window).scroll(function () {
          if (flag == true) {                 
              scroll = $(window).scrollTop(); 
              if (scroll &gt; 50) $('#scroll-down')[0].click();
               flag = false;  
          }                   
      });
  
      $(window).scroll(function () {
          if (flag == false) {                
              scroll = $(window).scrollTop(); 
              if (scroll &lt; 50 )
               flag = true;  
          }                   
      });     
  }); 
  </code></pre>
  
  <p>Any solutions for this ?</p>