# pure-drag

> drag function

Latest version **1.0.1** (published 2020-05-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install pure-drag
pnpm add pure-drag
yarn add pure-drag
bun add pure-drag
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-05-12 |
| First published | 2020-05-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 39.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | linjunfu |
| Maintainers | qingshanluoyue |
| Keywords | drag |

## Links

- npm: https://www.npmjs.com/package/pure-drag
- Repository: https://github.com/QingshanLuoyue/simple-drag
- Homepage: https://github.com/QingshanLuoyue/simple-drag#readme
- Issues: https://github.com/QingshanLuoyue/simple-drag/issues
- npm.io page: https://npm.io/package/pure-drag

## Recent versions

- 1.0.1 (latest) — 2020-05-12
- 1.0.0 — 2020-05-12

## README

### INSTALL

```
npm install pure-drag
```

or

```
yarn add pure-drag
```

<br>

### USAGE
css
```css
#dragparent {
    position: relative;
    width: 500px;
    height: 500px;
    border: 1px solid red
}
#dragson {
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: blue;
}
```

html
```html
<div id="dragparent">
    <div id="dragson"></div>
</div>
```

js


Drag at the parent
```javascript
import Drag from 'pure-drag'

let dragParent = document.getElementById('dragparent'),
    dragSon = document.getElementById('dragson')

new Drag({
    parent: dragParent,
    dragEle: dragSon
})
```

Global drag
```javascript
import Drag from 'pure-drag'
new Drag({
    dragEle: document.getElementById('dragson')
})
```

---
_Source: https://npm.io/package/pure-drag · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
