There are many scrolling plugins for mobile. But they are too large! eg. appframework(jqmobi) - af.scroller.js - 63K!
Oh, guy, I just want to add several simple pages for mobile, my small heart can't bear such a heavy. So, it's necessary to create s simple method for scrolling which doesn't have brilliant effect or complex functions, it's just made for scrolling.
About 4~5K, and small than 2K after compressing. Not small enough? If you still feel this js is large, ok, I true have smaller one, just contact me with email zhangxinxu@zhangxinxu.com
common mobile browser and IE9+/FF/Chrome/... desktop browser
simpScroller(container, options);
As follow:
{ verticalScroll: true, // scroll for vertical horizontalScroll: false, // scroll for horizontal hideScrollBar: false, // if the scrollbar should be showed onScroll: function() {} // a callback function which is triggered when scrolling // support a param that represent event object }