search

goog.positioning.AnchoredViewportPosition

Provided By
Extends
All Known Direct Subclasses

Encapsulates a popup position where the popup is anchored at a corner of an element. The corners are swapped if dictated by the viewport. For instance if a popup is anchored with its top left corner to the bottom left corner of the anchor the popup is either displayed below the anchor (as specified) or above it if there's not enough room to display it below.

When using this positioning object it's recommended that the movable element be absolutely positioned.

new AnchoredViewportPosition( anchorElement, corner, opt_adjust, opt_overflowConstraint )

Parameters
anchorElement(Element|null)

Element the movable element should be anchored against.

cornergoog.positioning.Corner

Corner of anchored element the movable element should be positioned at.

opt_adjustboolean=

Whether the positioning should be adjusted until the element fits inside the viewport even if that means that the anchored corners are ignored.

opt_overflowConstraint(goog.math.Box|null)=

Box object describing the dimensions in which the movable element could be shown.

Instance Methods

Instance Properties