function getAbsoluteTop (elem) {
  const rect = elem.getBoundingClientRect()
  return rect.top + window.pageYOffset || document.scrollTop || 0
}
Retrieve the absolute top value of a DOM element
@param {Element} elem    A dom element, for example a div
@return {Number} top     The absolute top position of this element
                         in the browser page.