Width of the rectangle box (This is identical to right minus left)
156157158159160161162163164165166
ClientRect popupArea = popup.position(); ClientRect targetArea = root.position(); popup.css("top", targetArea.bottom() + 15 + "px") .css("left", targetArea.left() - popupArea.width() / 2 + targetArea.width() / 2 + "px"); } /** * */