summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/etc/scroll.js
blob: 51e14a010c855d9871c5b94f3efcf279efa1691d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 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) {
  return NativeScroll(el)
  // if (accessibility.voiceOver) {
  //   return NativeScroll(el)
  // }
  // return new IScroll(el, opt)
}