Git Product home page Git Product logo

moo-swipe's Introduction

Moo Swipe

This project was built as a mootools element event that functions to gather swipe events on mobile devices.

Creating an Event

You can add a swipe event like this:

$('foo').addEvent('swipe', bar);

Where foo is the id of an element and bar is a function reference.

Important

Please note that in order for this to work on Android, touchmove's default functionality had to be prevented. This means that any object you add a swipe event to will no longer have use of such basic functionalities, like scrolling, so please apply it only to areas you need a swipe event.

While the same rule does not apply for iOS, we have implemented the prevention of functionality in order to maintain the same effects between iOS and Android use cases.

Event Object

The function (in this case bar) is given a single argument containing, at this point, two variables.

The object looks as such:

{
  axis: 0,
  dir: 1
}

Where axis can be either 0 or 1, where 0 indicates the x axis and 1 indicates the y axis. Currently, there is no support for diagonal swipes (this may be added later).

Dir refers to the direction. -1 indicates travel from higher numbered points to lower and 1 indicates lower numbered points to higher.

Contact

If you have any questions about this module, please feel free to contact me at [email protected]

moo-swipe's People

Contributors

deathbyjer avatar

Watchers

 avatar DMS Engineering team avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.