Class wink.plugins.ScrollToLoad
A plugin that allows to manage the expansion of the content during the scroll. The user may calibrate the wanted behavior by adjusting the pageSize property. The scroller is optional.
- Defined in: scrolltoload.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
wink.plugins.ScrollToLoad(properties)
|
| Compatibility list | Supported platforms / browsers |
|---|---|
|
iOS3, iOS4, iOS5, iOS6, Android 1.5, Android 2.1, Android 2.2, Android 2.3, Android 3.0, Android 3.1, Android 4.0, BlackBerry 6, BlackBerry 7, Bada 1.0, Windows Phone 7.5, Windows Phone 8
|
| Wink Version compatibility | Supported Wink version |
|---|---|
|
1.4
|
Method Summary
Class Detail
wink.plugins.ScrollToLoad(properties)
var ctx = {};
var scrollToLoad = new wink.plugins.ScrollToLoad(
{
scroller: new wink.ui.layout.Scroller(
{
target: 'scrollContent',
direction: 'y',
callbacks:
{
stopSliding: { context: ctx, method: 'onScroll' },
endScrolling: { context: ctx, method: 'onScroll' }
}
}),
content: wink.byId('scrollContent'),
waitText: 'Click here to load more',
loadingText: 'Loading...',
spinner: new wink.ui.xy.Spinner({ background: "light", size: 20 }),
pageSize: 600,
onPageChanged: function(pageindex, pagecount, onLoading, onEnd)
{
onLoading();
// load more or not depending on pageindex
onEnd();
},
onLoadMore: function(onLoading, onEnd)
{
onLoading();
// load more or not depending on pageindex
onEnd();
}
});
ctx.onScroll = wink.bind(scrollToLoad.onScroll, scrollToLoad);
- Parameters:
- {object} properties
- The properties object
- {wink.ui.layout.Scroller} properties.scroller Optional
- An optional scroller used
- {HTMLElement} properties.content
- The content node
- {string} properties.waitText
- The wait text
- {string} properties.loadingText
- The loading text
- {wink.ui.xy.Spinner} properties.spinner
- The spinner
- {integer} properties.pageSize Optional, Default: viewport_height
- The page size used to compute paging
- {function} properties.onPageChanged
- The callback called when the current page changed
- {function} properties.onLoadMore
- The callback called when the action to load more is raised
Field Detail
{integer}
uId
Unique identifier
Method Detail
-
onClick()method called when a click occurs
-
onScroll()method called when a scroll occurs