Clone an element outside the screen to safely get its height, then destroy it.
function getElementHeight (element) {
    var clone = element.cloneNode(true)
    clone.style.cssText = 'visibility: hidden; display: block; margin: -999px 0'

    var height = (element.parentNode.appendChild(clone)).clientHeight
    element.parentNode.removeChild(clone)

    return height
  }