1.0.21 • Published 7 years ago

vanilla-drag v1.0.21

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

Vanilla Drag

Build Status

A tiny (5KB) package to allow free dragging of HTML elements.

Example

Installation

npm install --save vanilla-drag

Getting Started

import VanillaDrag from 'vanilla-drag';

const target = document.getElementById('target');
const drag = new VanillaDrag(window, target);

Options

The VanillaDrag constructor takes two arguments.

new VanillaDrag([window], [HTMLElement])

window

The current context's window object. 99% of the time this will always be a case of passing in the global variable window.

HTMLElement

An instance of a HTMLElement that will have dragging enabled. Jquery users can access an instance of this object using the following Jquery index / method $('#target')[0] or $('#target').get(0). For Jquery collections containing multiple elements, the collection will need to be iterated over and a separate instance of VanillaDrag created for each item.

1.0.21

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago