Skip to content

yegao/draggify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

draggify

Make a HTMLElement draggable

  1. Draggify supports touch on mobile devices.
  2. Draggify is very fast.

usage

npm i -S draggify
import draggify from 'draggify';

draggify(document.querySelector('#element'), {
    // Whether horizontal movement is allowed.
    x: true,
    // Whether vertical movement is allowed.
    y: true,
    // A callback performed in idle time after the dragging has finished.
    idle: () =>  { 
        console.log('xxxx')
    },
    // Garbage collection.
    gc: true
});

Have a try

https://yegao.github.io/draggify

About

Make a HTMLElement draggable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published