Class: Snap

Snap

new Snap(cfg)

a snap plugin for xscroll,wich support vertical and horizontal snap.
Name Type Description
cfg object
Name Type Description
snapColIndex number initial col index
snapRowIndex number initial row index
snapDuration number duration for snap animation
snapEasing string easing for snap animation
snapOffsetLeft number an offset from left boundry for snap wich default value is 0
snapOffsetTop number an offset from top boundry for snap wich default value is 0
autoStep boolean which step is based on scroll velocity

Extends

Members

staticSnap.pluginIdstring

a pluginId

Methods

staticSnap.pluginDestructor()

detroy the plugin

staticSnap.pluginInitializer(){Snap}

plugin initializer

staticSnap.render(){Snap}

render snap plugin

staticSnap.snapTo(col, row, duration, easing, callback){Snap}

scroll to a col and row with animation
Name Type Description
col number col-index
row number row-index
duration number duration for animation ms
easing string easing for animation
callback function callback function after animation

staticSnap.snapToCol(col, duration, easing, callback){Snap}

scroll to a col with animation
Name Type Description
col number col-index
duration number duration for animation ms
easing string easing for animation
callback function callback function after animation

staticSnap.snapToRow(row, duration, easing, callback){Snap}

scroll to a row with animation
Name Type Description
row number row-index
duration number duration for animation ms
easing string easing for animation
callback function callback function after animation