Giter Site home page Giter Site logo

casperpanduro / touchswipe-jquery-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattbryson/touchswipe-jquery-plugin

0.0 2.0 0.0 1.1 MB

TouchSwipe is a jquery plugin to be used with jQuery on touch input devices such as iPad, iPhone etc.

Home Page: http://labs.rampinteractive.co.uk/touchSwipe/

License: Other

HTML 47.71% CSS 0.74% JavaScript 51.55%

touchswipe-jquery-plugin's Introduction

TouchSwipe 1.6

A jQuery plugin to be used on touch devices such as iPad, iPhone, Android etc.

Detects single and multiple finger swipes, pinches and falls back to mouse 'drags' on the desktop.

Time and distance thresholds can be set to distinguish between swipe gesture and slow drag.

Allows exclusion of child elements (interactive elements) as well allowing page scrolling or page zooming depending on configuration.

  • Detects swipes in 4 directions, "up", "down", "left" and "right"
  • Detects pinches "in" and "out"
  • Supports single finger or double finger touch events
  • Supports click events both on the touchSwipe object and its child objects
  • Definable threshold / maxTimeThreshold to determin when a gesture is actually a swipe
  • Events triggered for swipe "start","move","end" and "cancel"
  • End event can be triggered either on touch release, or as soon as threshold is met
  • Allows swiping and page scrolling
  • Disables user input elements (Button, form, text etc) from triggering swipes

Demos, examples and docs

http://labs.rampinteractive.co.uk/touchSwipe
http://labs.rampinteractive.co.uk/touchSwipe/docs

Installation

NPM

npm install jquery-touchswipe --save

Bower

bower install jquery-touchswipe --save

Manual

Include the minified file in your project.

<script type="text/javascript" src="js/jquery.touchSwipe.min.js"></script>

Usage

$(function() {
  $("#test").swipe( {
    //Generic swipe handler for all directions
    swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
      $(this).text("You swiped " + direction );  
    }
  });

  //Set some options later
  $("#test").swipe( {fingers:2} );
});

For full demos, code examples and documentation, see below.

Development

Install dependencies

npm install

To minify

npm run minify

To build docs

npm run docs

To do both

npm run build

For port to XUI see:

https://github.com/cowgp/xui-touchSwipe

touchswipe-jquery-plugin's People

Contributors

mattbryson avatar tujoworker avatar billy- avatar natemrice avatar jerone avatar adelina-simion avatar damianwajer avatar maddoxej avatar daflip avatar jimt avatar joelhy avatar jonatron avatar kkirsche avatar lbernau avatar mtyaka avatar miracle2k avatar mreinstein avatar beatspace avatar norric avatar nextend avatar tomfuertes avatar uzitech avatar willosof avatar wyoumans avatar xanhast avatar jdalton avatar

Watchers

James Cloos avatar Casper Panduro 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.