title: How to avoid recursion calling scrollIntoView() in scroll event-handler?
body: <p>I want to divide my site into several screen-sized section and automatically scroll to the next section when user starts scrolling. To achieve it I wrote code like this:</p>
  
  <pre><code>$(window).scroll(function() {
      getElementToScroll().scrollIntoView({behavior: "smooth"});
  }
  </code></pre>
  
  <p>But there's a recursion caused by calling <code>scrollIntoView()</code>. How can I avoid this problem? Maybe there's another more suitable way to scroll element into view? </p>
  
  <p>P.S. Smooth behavior is necessary.</p>