Skip to content
/ momo Public

A framework and a collection for separate and simple implementation of touch gestures

Notifications You must be signed in to change notification settings

dexteryy/momo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Momo (MoMotion)

  • A framework and a collection for separate and simple implementation of touch gestures

AMD and OzJS

Get the Code

Add to your project as new dependency

Or download directly from Github

Dependencies

Modules Overview

  • A sample implementation for adapter
  • A simple framework
  • 'tap', 'doubletap', 'hold', 'tapstart', 'tapcancel'
  • 'scrolldown', 'scrollup', 'scrollstart', 'scrollend'
  • 'swipeup', 'swipedown', 'swiperight', 'swipeleft'

momo/drag (beta)

  • 'drag', 'dragover', 'dragstart', 'dragend'

Examples

  • Comming soon...

API and usage

momo

var momo = require('momo');
  • momo.init() -
  • momo.tap() -
  • momo.scroll() -
  • momo.swipe() -
  • momo.drag() -

momo/base

Defaults:

  • namespace: ""
var momoBase = require('momo/base');
var MomoBase = momoBase.Class;
  • MomoBase.prototype.config --
  • MomoBase.prototype.enable --
  • MomoBase.prototype.disable --
  • MomoBase.prototype.once --
  • MomoBase.prototype.event --
  • MomoBase.prototype.SUPPORT_TOUCH --
  • MomoBase.prototype.bind -- [adapter]
  • MomoBase.prototype.unbind -- [adapter]
  • MomoBase.prototype.trigger -- [adapter]
  • MomoBase.prototype.press -- [hook]
  • MomoBase.prototype.move -- [hook]
  • MomoBase.prototype.release -- [hook]
  • MomoBase.prototype.cancel -- [hook]

momo/tap

Defaults:

  • tapRadius: 10
  • doubleTimeout: 300
  • tapThreshold: 0
  • holdThreshold: 500
var momoTap = require('momo/tap');
var tapGesture = momoTap(element, /* optional */ config, /* optional */ handler);
  • element.addEventListener('tap', handler)
  • element.addEventListener('doubletap', handler)
  • element.addEventListener('hold', handler)
  • element.addEventListener('tapstart', handler)
  • element.addEventListener('tapcancel', handler)

momo/scroll

Defaults:

  • directThreshold: 5
  • scrollEndGap: 5
var momoScroll = require('momo/scroll');
var scrollGesture = momoScroll(element, /* optional */ config, /* optional */ handler);
  • scrollGesture.watchScroll(element) -
  • element.addEventListener('scrolldown', handler)
  • element.addEventListener('scrollup', handler)
  • element.addEventListener('scrollstart', handler)
  • element.addEventListener('scrollend', handler)

momo/swipe

Defaults:

  • timeThreshold: 200
  • distanceThreshold: 20
var momoSwipe = require('momo/swipe');
var swipeGesture = momoSwipe(element, /* optional */ config, /* optional */ handler);
  • element.addEventListener('swipedown', handler)
  • element.addEventListener('swipeup', handler)
  • element.addEventListener('swipeleft', handler)
  • element.addEventListener('swiperight', handler)

momo/drag

  • Comming soon...

Under construction...

More References

See OzJS Project Homepage

Release History

See OzJS Release History

License

Copyright (c) 2010 - 2013 dexteryy
Licensed under the MIT license.

About

A framework and a collection for separate and simple implementation of touch gestures

Resources

Stars

Watchers

Forks

Packages

No packages published