The goog.positioning.ViewportPosition Class

goog.positioning.ViewportPosition
> goog.positioning.AbstractPosition

goog.positioning.ViewportPosition(arg1, opt_arg2)

Encapsulates a popup position where the popup is positioned according to coordinates relative to the element's viewport (page). This calculates the correct position to use even if the element is relatively positioned to some other element.

arg1 {number|goog.math.Coordinate}
Left position or coordinate.
opt_arg2 {number=}
Top position.

.reposition(element, popupCorner, opt_margin, opt_preferredSize)

Repositions the popup according to the current state

element {Element}
The DOM element of the popup.
popupCorner {goog.positioning.Corner}
The corner of the popup element that that should be positioned adjacent to the anchorElement.
opt_margin {goog.math.Box=}
A margin specified in pixels.
opt_preferredSize {goog.math.Size=}
Preferred size of the element.