code: function viewable(el, bounds){
      var rect = el.getBoundingClientRect();
      return (
        (rect.top + rect.height) >= 0 &&
        (rect.left + rect.width) >= 0 &&
        (rect.bottom - rect.height) <= ( (window.innerHeight || document.documentElement.clientHeight) + bounds) &&
        (rect.right - rect.width) <= ( (window.innerWidth || document.documentElement.clientWidth) + bounds)
      );
    }
docs: determine if a given element (plus an additional "bounds" area around it) is in the viewport