index.js
function getPos(el) {
  var rect = el.getBoundingClientRect(),
    scrollY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;

  return {
    top: rect.top + scrollY,
    bottom: rect.top + rect.height + scrollY,
    height: rect.height
  };
}
function getPos(el) {
  var rect = el.getBoundingClientRect(),
    scrollY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;

  return {
    top: rect.top + scrollY,
    bottom: rect.top + rect.height + scrollY,
    height: rect.height
  };
}
function getPos ( el ) { var rect = el . getBoundingClientRect ( ) , scrollY = window . pageYOffset || document . documentElement . scrollTop || document . body . scrollTop ; return { top : rect . top + scrollY , bottom : rect . top + rect . height + scrollY , height : rect . height } ; }
Get the position of a DOM element
@param  {Element} el
@return {object}
Get the position of a DOM element