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
  }
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
  }
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 }
Clone an element outside the screen to safely get its height, then destroy it.
Clone an element outside the screen to safely get its height then destroy it .