code: function positionElement(element, target, alignment) {
      var elementPoint = elementPositioningPoint(element, alignment.overlay);
      var targetPoint = elementPositioningPoint(target, alignment.target);
      var offset = {
          left: targetPoint.left - elementPoint.left,
          top: targetPoint.top - elementPoint.top
      };
      return {
          left: element.left + offset.left,
          top: element.top + offset.top,
          width: element.width,
          height: element.height
      };
  }
docs: Align @{element} with specified @{target} by calculating new @{element} position rectangle.