Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mnmly/drag

Drag component
https://github.com/mnmly/drag

Last synced: about 1 month ago
JSON representation

Drag component

Awesome Lists containing this project

README

        

# drag

drag component

## Installation

$ component install mnmly/drag

## Events

- `dragstart` when drag starts
- `drag` when dragging
- `dragend` when drag finishes

## API

- [Drag()](#drag)
- [Drag.bind()](#dragbind)
- [Drag.unbind()](#dragunbind)

## Drag( el, options )

Turn `el` into draggable element.

### Options

- `smooth` enables `translate3d` positioning
- `axis` constrains drag direction `x` or `y`
- `range` constrains value to its range

## Drag.bind()

Bind event handlers

## Drag.unbind()

Unbind event handlers

## License

MIT