Yahoo! UI Library

scrollview-paginator  3.2.0pr1

Yahoo! UI Library > scrollview-paginator > Plugin.ScrollViewPaginatorPlugin
Search:
 
Filters

Class Plugin.ScrollViewPaginatorPlugin - extends Plugin.Base

Scrollview plugin that adds support for paging

Constructor

Plugin.ScrollViewPaginatorPlugin ( )

Properties

ScrollViewPaginator.ATTRS - static Object

The default attribute configuration for the plugin

ScrollViewPaginator.NAME - static String

The identity of the plugin
Default Value: 'paginatorPlugin'

ScrollViewPaginator.NS - static String

The namespace on which the plugin will reside
Default Value: 'pages'

Properties inherited from Attribute:

Properties inherited from Base:

Properties inherited from Plugin.Base:

Methods

_afterFlick

protected void _afterFlick ( e )
Executed as soon as the flick event occurs. This is needed to determine if the next or prev page should be activated.
Parameters:
e <Event.Facade> The flick event facade.

_afterIndexChange

protected void _afterIndexChange ( )
index attr change handler

_calculatePageOffsets

protected void _calculatePageOffsets ( )
Pre-calculate the min/max boundary points when the contentBox changes

_scrollEnded

protected void _scrollEnded ( )
scrollEnd handler detects if a page needs to change

_setBoundaryPoints

void _setBoundaryPoints ( e )
After host movestart handler, reset min/max scroll values on the host based on the page elements
Parameters:
e <Event.Facade> The gesturemovestart event

_uiIndex

protected void _uiIndex ( )
Update the UI based on the current page index

destroy

void destroy ( )
Destructor removes anything added by the plugin

initializer

void initializer ( )
Designated initializer

next

void next ( disableAnim )
Scroll to the next page in the scrollview, with animation
Parameters:
disableAnim <Boolean> If true, no animation is used

prev

void prev ( disableAnim )
Scroll to the previous page in the scrollview, with animation
Parameters:
disableAnim <Boolean> If true, no animation is used

scrollTo

void scrollTo ( index , duration , easing )
Scroll to a given page in the scrollview, with animation.
Parameters:
index <Number> The index of the page to scroll to
duration <Number> The number of ms the animation should last
easing <String> The timing function to use in the animation

snapToCurrent

void snapToCurrent ( )
Snaps the scrollview to the currently selected page

Events

indexChange

indexChange ( event )
Fires when the value for the configuration attribute 'index' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

selectorChange

selectorChange ( event )
Fires when the value for the configuration attribute 'selector' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

totalChange

totalChange ( event )
Fires when the value for the configuration attribute 'total' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

Events inherited from Base:

Events inherited from Plugin.Base:

Configuration Attributes

index - {Number}

The active page number for a paged scrollview
Default Value: 0

selector - {String}

CSS selector for a page inside the scrollview. The scrollview will snap to the closest page.

total - {Number}

The total number of pages
Default Value: 0

Configuration attributes inherited from Base:

Configuration attributes inherited from Plugin.Base:


Copyright © 2010 Yahoo! Inc. All rights reserved.