Class Plugin.ScrollViewPaginator
- extends Plugin.Base
Scrollview plugin that adds support for paging
Constructor
Plugin.ScrollViewPaginator
(
)
Properties
The default attribute configuration for the plugin
The identity of the plugin
Default Value: 'paginatorPlugin'
The namespace on which the plugin will reside
Default Value: 'pages'
Properties inherited from Base:
Methods
protected
void
_afterIndexChange
(
)
index attr change handler
protected
void
_afterRender
(
)
After host render handler
protected
void
_calcOffsets
(
)
Calculate the page boundary offsets
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.
protected
void
_scrollEnded
(
)
scrollEnd handler detects if a page needs to change
protected
void
_uiIndex
(
)
Update the UI based on the current page index
void
initializer
(
)
Designated initializer
void
next
(
)
Scroll to the next page in the scrollview, with animation
void
prev
(
)
Scroll to the previous page in the scrollview, with animation
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
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,
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 Base:
_aggregateAttrs,
_defDestroyFn,
_defInitFn,
_destroyHierarchy,
_filterAttrCfs,
_getAttrCfgs,
_getClasses,
_initHierarchy,
_initHierarchyData,
_preInitEventCfg,
destroy,
init,
toString
Events
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
(
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
(
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:
Configuration Attributes
index
- {Number}
The active page number for a paged scrollview
Default Value: 0
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: