Hey every body
I've made few changes for myself to iScroll,
and I think these changes may interest others (and maybe good enouth to be integrated to the official iScroll?).
- a jquery plugin for iscroll (at the end of the file), very usefull for jquery lovers:
$('.myScrolls').scrollCreate({hScroll:false,on...});
$('.myScrolls').scrollTo(…);
if ( ! $('.myScrolls')[0].iScroll.animating) {}
$('.myScrolls').scrollRefresh();
$('.myScrolls').scrollDisable();
$('.myScrolls').scrollRemove();
no need to store the iScroll object anymore.
- added a onResize event,
called when the size of the wapper change.
by default this method do: this.scrollToPage(this.currPageX, this.currPageY, 0);
that avoid a bug: onorientationchange, snap scrolls are not snaped
- fix: recalculate currPageX/Y on every scroll change and not only during the scrollToPage call (for the default onResize method work)
- change: option.snapThreshold (default 1px too short) is now the ration of the width or height a swipe must have to change page (default 1/4).
you can see diff between my file in attachment and the latest version of iScroll (v4.1.9 in the header)