kobaatsu
3/30/2015 - 6:40 AM

# オリジナル http://www.almondlab.jp/labs/1377

bindSwipe = ($target, callback)->
  x = 0
  direction = ""
  getX = (e)->
    return e.originalEvent.touches[0].pageX;

  $target
    .on "touchstart", (e)->
      x = getX e
    .on "touchmove", (e)->
      direction = if (x > getX(e)) then "left" else "right"
    .on "touchend", ->
      callback direction