code: function offsetTop (elem) {
      let top = 0
  
      do {
        if (!isNaN(elem.offsetTop)) top += elem.offsetTop
      } while (elem = elem.offsetParent)
  
      return top
    }
docs: Recursively calculate top offset of an element from the body