Class: Infinite

Infinite

new Infinite(cfg)

An infinity dom-recycled list plugin for xscroll.
Name Type Description
cfg object
Name Type Description
transition string recomposition cell with a transition
infiniteElements string dom-selector for reused elements
renderHook function render function for cell by per col or per row duration scrolling

Extends

Members

staticInfinite.pluginIdstring

a pluginId

staticInfinite.sectionsobject

store all elements data.

staticInfinite.visibleElementsobject

store the visible elements inside of view.

Methods

staticInfinite.append(sectionId, data){Infinite}

append data after a section
Name Type Description
sectionId string sectionId for the append cell
data object data to append

staticInfinite.get(sectionId, index){object}

get data by sectionId and index
Name Type Description
sectionId string sectionId
index number index in the section
Returns:
data

staticInfinite.getVisibleElements(pos){object}

get all elements inside of the view.
Name Type Description
pos number scrollLeft or scrollTop

staticInfinite.insertAfter(sectionId, index, data){Infinite}

insert data after a position
Name Type Description
sectionId string sectionId of the target cell
index number index of the target cell
data object data to insert

staticInfinite.insertBefore(sectionId, index, data){Infinite}

insert data before a position
Name Type Description
sectionId string sectionId of the target cell
index number index of the target cell
data object data to insert

staticInfinite.pluginDestructor(){Infinite}

detroy the plugin

staticInfinite.pluginInitializer(){Infinite}

plugin initializer

staticInfinite.remove(sectionId, from, number){Infinite}

remove some data by sectionId,from,number
Name Type Description
sectionId string sectionId for the append cell
from number removed index from
number number removed data number

staticInfinite.render(){Infinite}

render or update the scroll contents

staticInfinite.replace(sectionId, index, data){Infinite}

replace some data by sectionId and index
Name Type Description
sectionId string sectionId to replace
index number removed index from
data object new data to replace

Events

Infinite.event:pan

pan event
Name Type Description
e object events data include cell object

Infinite.event:panend

panend event
Name Type Description
e object events data include cell object

Infinite.event:panstart

panstart event
Name Type Description
e object events data include cell object

Infinite.event:tap

tap event
Name Type Description
e object events data include cell object