WinJS.UI.Pivot object

Applies to Windows Phone only

Creates a tab control that displays multiple items.

Syntax


<div data-win-control="WinJS.UI.Pivot"></div>


var object = new WinJS.UI.Pivot(element, options);

Members

The Pivot object has these types of members:

Constructors

The Pivot object has these constructors.

ConstructorDescription
Pivot

Creates a new Pivot control.

 

Events

The Pivot object has these events.

EventDescription
onitemanimationend

Raised when a PivotItem control's animation ends

onitemanimationstart

Raised when a PivotItem control's animation starts.

onselectionchanged

Raised when the user changes to a different PivotItem.

 

Methods

The Pivot object has these methods.

MethodDescription
addEventListener

Registers an event handler for the specified event.

dispatchEvent

Raises an event of the specified type and with additional properties.

dispose

Releases resources held by this Pivot. Call this method when the Pivot is no longer needed. After calling this method, the Pivot becomes unusable.

removeEventListener

Removes an event handler that the addEventListener method registered.

 

Properties

The Pivot object has these properties.

PropertyAccess typeDescription

element

Read/write

Gets the DOM element that hosts the Pivot control.

items

Read/write

Gets or sets the List that contains the PivotItem objects that belong to this Pivot.

locked

Read/write

Gets or sets a value that specifies whether the Pivot control is locked to the current item.

selectedIndex

Read/write

Gets or sets the index of the PivotItem control in view.

selectedItem

Read/write

Gets or sets the PivotItem control in view within the Pivot control.

title

Read/write

Gets or sets the title displayed above the PivotItem controls.

 

Remarks

The Pivot control is supported on Windows Phone 8.1, but not Windows. On Windows, use the Hub control instead.

Styling the Pivot

CSS classes

To customize the Pivot, you can define your own styles for these Cascading Style Sheets (CSS) classes (defined by the Windows Library for JavaScript style sheets):

CSS classDescription

win-pivot

Styles the entire Pivot control.

win-pivot-title

Styles the title of the Pivot control.

win-pivot-headers

Styles the headers of individual PivotItem controls in the Pivot control. Headers are layout sensitive, so settings styles can disrupt the Pivot control.

win-pivot-header

Styles a header in the Pivot control

win-pivot-locked

Styles the Pivot control when it is locked.

win-pivot-progress

Styles the progress indicator of the Pivot control.

win-pivot-viewport

Styles the viewport of the Pivot control.

 

Requirements

Minimum supported client

None supported [Windows Store apps only]

Minimum supported server

None supported [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.UI

Library

Ui.js

 

 

Show:
© 2014 Microsoft