src/tooltip.js
function offsetLeft (elem) {
    let left = 0

    do {
      if (!isNaN(elem.offsetLeft)) left += elem.offsetLeft
    } while (elem = elem.offsetParent )

    return left
  }
function offsetLeft (elem) {
    let left = 0

    do {
      if (!isNaN(elem.offsetLeft)) left += elem.offsetLeft
    } while (elem = elem.offsetParent )

    return left
  }
function offsetLeft ( elem ) { let left = 0 do { if ( ! isNaN ( elem . offsetLeft ) ) left += elem . offsetLeft } while ( elem = elem . offsetParent ) return left }
Recursively calculate left offset of an element from the body
Recursively calculate left offset of an element from the body