pure-drag

1.0.1 • Public • Published

INSTALL

npm install pure-drag

or

yarn add pure-drag

USAGE

css

#dragparent {
    position: relative;
    width: 500px;
    height: 500px;
    border: 1px solid red
}
#dragson {
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: blue;
}

html

<div id="dragparent">
    <div id="dragson"></div>
</div>

js

Drag at the parent

import Drag from 'pure-drag'
 
let dragParent = document.getElementById('dragparent'),
    dragSon = document.getElementById('dragson')
 
new Drag({
    parent: dragParent,
    dragEle: dragSon
})

Global drag

import Drag from 'pure-drag'
new Drag({
    dragEle: document.getElementById('dragson')
})

Readme

Keywords

Package Sidebar

Install

npm i pure-drag

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

40 kB

Total Files

8

Last publish

Collaborators

  • qingshanluoyue