Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Pivot.onselectionchanged event

Applies to Windows and Windows Phone

Raised when the PivotItem changes.

Syntax


<div data-win-control="WinJS.UI.Pivot" data-win-options="{onselectionchanged : handler}" />


function handler(eventInfo) { /* Your code */ }
 
// addEventListener syntax
pivot.addEventListener("selectionchanged", handler);
pivot.removeEventListener("selectionchanged", handler);


Event information

SynchronousNo
BubblesYes
CancelableYes

 

Event handler parameters

eventInfo

Type: CustomEvent

An object that contains information about the event. The detail property of this object contains the following sub-properties:

detail.direction

The direction that the user moved the Pivot control as a string. Values can be "forward" or "backwards".

detail.index

The index of the selected PivotItem within the Pivot control.

detail.item

The selected PivotItem.

Remarks

This event fires when the PivotItem changes (does not have to be triggered by the user).

Note   For Windows, this member is available starting with the WinJS 3.0 library. The WinJS 3.0 library is available via CDN, package manager, or website download but currently not through the Windows Store as a Windows Store framework package.
 

Requirements

Minimum WinJS version

Phone WinJS 2.1

Namespace

WinJS.UI

See also

Pivot

 

 

Show: