diff options
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js')
| -rw-r--r-- | StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js new file mode 100644 index 00000000..253921e1 --- /dev/null +++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/scroll.js @@ -0,0 +1,29 @@ +// stub for native scroller when in voiceover mode +function NativeScroll(el) { + var Scroller = { + x: 0, + y: 0, + $el: $(el), + } + + Scroller.refresh = function(){} + Scroller.on = function(){} + Scroller.off = function(){} + + Scroller.scrollTo = function(x, y) { + Scroller.$el.scrollTop(y) + } + Scroller.scrollToElement = function(selector) { + var y = $(selector).offset().top + Scroller.$el.scrollTop(y) + } + + return Scroller +} + +function ScrollFactory (el, opt) { + if (accessibility.voiceOver) { + return NativeScroll(el) + } + return new IScroll(el, opt) +} |
