function checkViewport(el) { var H = document.documentElement.clientHeight, pos = el.getBoundingClientRect(); return pos.top > 0 && pos.bottom < H }