;
sizeY = (y - []);
sizeY = sizeY ? ( - y) / sizeY * 500 : 0;
= page;
// Snap with constant speed (proportional duration)
time = ((sizeX, sizeY)) || 200;
return { x: x, y: y, time: time };
},
_bind: function (type, el, bubble) {
(el || ).addEventListener(type, this, !!bubble);
},
_unbind: function (type, el, bubble) {
(el || ).removeEventListener(type, this, !!bubble);
},
/**
*
* Public methods
*
*/
destroy: function () {
var that = this;
[transform] = '';
// Remove the scrollbars
= false;
= false;
that._scrollbar('h');
that._scrollbar('v');
// Remove the event listeners
that._unbind(RESIZE_EV, window);
that._unbind(START_EV);
that._unbind(MOVE_EV, window);
that._unbind(END_EV, window);
that._unbind(CANCEL_EV, window);
if (!) {
that._unbind('DOMMouseScroll');
that._unbind('mousewheel');
}
if () that._unbind(TRNEND_EV);
if () clearInterval();
if () (that);
},
refresh: function () {
var that = this,
offset,
i, l,
els,
pos = 0,
page = 0;
if ( < ) = ;
= || 1;
= || 1;
= - || 0;
= ( * );
= (( + ) * );
= - ;
= - + ;
= 0;
= 0;
if () (that);
= && < 0;
= && (! && ! || > );
= && ;
= && && > ;
offset = that._offset();
= -;
= -;
// Prepare snap
if (typeof == 'string') {
= [];
= [];
els = ();
for (i=0, l=; i<l; i++) {
pos = that._offset(els[i]);
+= ;
+= ;
[i] = < ? : * ;
[i] = < ? : * ;
}
} else if () {
= [];
while (pos >= ) {
Previous page12345Next pageRead the full text