IZoomableView.positionItem method

Applies to Windows and Windows Phone

Positions the specified item within the viewport of the child control when panning or zooming begins.

Syntax


iZoomableView.positionItem(item, position).done( /* Your success and error handlers */ );

Parameters

item

Type: Variant

The object to position within the viewport of the child control.

item can be a number, a string, or an object with any number of properties.

position

Type: Variant

An object that contains the position data of the item relative to the child control.

position must be an object with four number properties: left, top, width, and height.

These values specify a rectangle that is typically the bounding box of the current item, though the details are up to the control. The units of the position must be in pixels. And the coordinates must be relative to the top-left of the control viewport (which should occupy the same area as the semantic zoom viewport), except when in RTL mode. In RTL mode, return coordinates relative to the top-right off the control viewport.

The rectangle is transformed from the coordinate system of one control to that of the other.

Return value

Type: Promise

When completed, this promise returns an object with x and y properties, which represent the location of the positioned item.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.UI

See also

IZoomableView

 

 

Show:
© 2014 Microsoft