다음을 통해 공유


ListView.indexOfFirstVisible property

Gets or sets the first visible item.

Syntax

<div 
    data-win-control="WinJS.UI.ListView" 
    data-win-options="{ indexOfFirstVisible : value}">
</div>
var indexOfFirstVisible = listView.indexOfFirstVisible;
listView.indexOfFirstVisible = indexOfFirstVisible;

Property value

Type: Number

The index of the first visible item. When you set this property, the ListView scrolls so that the item with the specified index is the first visible item.

Remarks

Just before your app snaps, store the ListView control's indexOfFirstVisible value, and then restore it when the app unsnaps so that the user doesn't lose their position in the list.

Requirements

Minimum WinJS version

WinJS 3.0

Namespace

WinJS.UI

See also

ListView