title: Couldn't stop the function when another function
body: <p>I have this code where when I scroll down it will continue scroll and the same when scrolling upwards.</p>
  
  <pre><code>var currentpos = 0
  
  function scrollwindow1() {
      currentpos = window.pageYOffset + 1
      window.scroll(0, currentpos)
  }
  
  function scrollwindow() {
      currentpos = window.pageYOffset - 1
      window.scroll(0, currentpos)
  }
  $('body').on('mousewheel', function(e) {
      if (e.originalEvent.wheelDelta &gt; 0) {
          console.log('up 3');
          clearInterval("scrollwindow1()")
          setInterval("scrollwindow()", 20)
      } else {
          console.log('down 3');
          clearInterval("scrollwindow()")
          setInterval("scrollwindow1()", 20)
      }
  });
  </code></pre>
  
  <p>but with this, it didn't stop the interval. the function only contradict the other function</p>