title: Run a function constantly
body: <p>I'm using the excellent <a href="https://github.com/protonet/jquery.inview" rel="nofollow">inView</a> plugin to check if an element is visible in the viewport, using setInterval, but the function only runs once and only when the element IS visible, not otherwise (should run else statement).</p>
  
  <pre><code>var checkViewport = setInterval(function() {
      $('#colorbox').on('inview', function(event, visible) {
        if (visible) {
          console.log('YES');
        } else {
          console.log('NO');
        }
      });
  }, 5000);
  </code></pre>