code: function(v1, v2, e1, e2) {
          return !((e1 < v1 && e2 < v1) || (e1 > v2 && e2 > v2));
      }
docs: One-dimensional collision detection. It checks to see if start/end are both either before the viewport, and after. If it's not before or after, it's colliding.