<!DOCTYPE html>
<html>
<head>
  <title>Invisible element example</title>

  <style>
    .context {
      margin-bottom: 2000px;
    }
    .hidden {
      display: none;
    }
  </style>
</head>
<body>
  <div class="context">Coucou</div>

  <div class="hidden">
    <div class="test"></div>
  </div>

  <script src="../build/in-viewport.min.js"></script>

  <script>
  var el = document.querySelector('.test');

  inViewport(el, function() {
    alert('YES');
  });
  </script>
</body>
</html>

Add an example with invisible element
Add an example with invisible element