code: function getOffsetParent(el) {
    var offsetParent = el.offsetParent;
  
    if (!offsetParent || offsetParent === document.body && getComputedStyle(document.body).position === 'static') {
      offsetParent = document.body.parentElement;
    }
  
    return offsetParent;
  }
docs: there is some trap in el.offsetParent, so use this func to fix