ryanwalters / simple-swipes

Detect swipes in 164 bytes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Swipes Build Status

Detect swipes in 164 bytes (gzipped).

###Usage:

  • Include swipes.js - bower install simple-swipes or download it

  • Bind to the swipe event

      $element.on('swipe', function (event) {
          switch (event.originalEvent.detail.direction) {
              case 'UP':
                  ...
              case 'RIGHT':
                  ...
              case 'DOWN':
                  ...
              case 'LEFT':
                  ...
          }
      });
    
  • Note: jQuery isn't required, just used for demonstration purposes

###Demo:

###Author:

About

Detect swipes in 164 bytes.

License:MIT License


Languages

Language:JavaScript 100.0%