Skip to content

About

A simple Javascript function to handle swipe action

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

js_touch_swipe_function

A simple Javascript function to handle swipe action

This function allow you to handler basic swipe action (left, right, up, down) on mobile screen.

You can define parameter to the swipe function :

  • element where the swipe action is listen
  • delta : when the detection start

You must define a callback function which one listen action (left, right, up, down)

/**
* @param1 - DOM element or custom querySelector
* @param2 - delta when detection "start"
* @param3 - callback function
**/
 
 swipe('*', 0, function(e) {
    switch (e) {
        case 'left':
            /** do something **/

            break;
        case 'right':
            /** do something **/
            
            break;
        case 'up':
            /** do something **/
            
            break;
        case 'down':
            /** do something **/
            
            break;
    }

About

A simple Javascript function to handle swipe action

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages