# Yahoo! UI Library

### scrollview-paginator 3.3.0

Yahoo! UI Library > scrollview-paginator > Plugin.ScrollViewPaginator
Search:
Filters Show Private Show Protected Show Deprecated

## Class Plugin.ScrollViewPaginator - extends Plugin.Base

Scrollview plugin that adds support for paging

### Constructor

Plugin.ScrollViewPaginator `( )`

### 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 Plugin.Host:

`PluginHost`

#### Properties inherited from Attribute:

``

#### Properties inherited from Base:

`name`

#### Properties inherited from Plugin.Base:

`_handles`

### Methods

#### _afterIndexChange

`protected void _afterIndexChange ( )`
index attr change handler

#### _afterRender

`protected void _afterRender ( )`
After host render handler

#### _calcOffsets

`protected void _calcOffsets ( )`
Calculate the page boundary offsets

#### _flickFrame

`protected void _flickFrame ( )`
Executed to respond to the flick event, by over-riding the default flickFrame animation. This is needed to determine if the next or prev page should be activated.

#### _scrollEnded

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

#### _uiIndex

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

#### initializer

`void initializer ( )`
Designated initializer

#### next

`void next ( )`
Scroll to the next page in the scrollview, with animation

#### prev

`void prev ( )`
Scroll to the previous page in the scrollview, with animation

#### 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

#### Methods inherited from EventTarget:

`_getType, _monitor, _parseType, addTarget, after, before, bubble, detach, detachAll, fire, getEvent, getTargets, on, once, parseType, publish, removeTarget, subscribe, unsubscribe, unsubscribeAll`

#### Methods inherited from Attribute:

`_addAttrs, _addLazyAttr, _defAttrChangeFn, _fireAttrChange, _getAttr, _getAttrCfg, _getAttrInitVal, _getAttrs, _getStateVal, _isLazyAttr, _normAttrVals, _protectAttrs, _set, _setAttr, _setAttrs, _setAttrVal, _setStateVal, addAttr, addAttrs, attrAdded, get, getAttrs, modifyAttr, removeAttr, reset, set, setAttrs`

#### Methods inherited from Plugin.Host:

`_destroyPlugins, _initPlugins, hasPlugin, plug, unplug`

#### Methods inherited from Base:

`_aggregateAttrs, _defDestroyFn, _defInitFn, _destroyHierarchy, _filterAttrCfs, _getAttrCfgs, _getClasses, _initHierarchy, _initHierarchyData, _preInitEventCfg, destroy, init, toString`

#### Methods inherited from Plugin.Base:

`afterHostEvent, afterHostMethod, beforeHostMethod, destructor, doAfter, doBefore, initializer, onHostEvent`

### 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:

`destroy, destroyedChange, init, initializedChange,`

#### Events inherited from Plugin.Base:

`hostChange,`

### 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:

`destroyed initialized`

#### Configuration attributes inherited from Plugin.Base:

`host`

Copyright © 2011 Yahoo! Inc. All rights reserved.