1.0.7 • Published 7 years ago
draggable-el v1.0.7
DraggableEl
Browser Support
This lib uses transform-function, requestAnimationFrame. Their compatibilities are:
Chrome, Firefox, Safari, Edge15, IE10
Usage
demo
- download package
npm i --save draggable-el- import with
requireor<script>
let DraggableEl = require('draggable-el')or
<script src="./node_modules/draggable-el/dist/DraggableEl.min.js"></script>- initialize/destroy instance
- initialize instance
let config = {
dragButton: document.getElementById('app__drag_el'),
dragEl: document.getElementById('app__drag_bo')
}
let instance1 = new DraggableEl(config)more about config
- destroy instance
instance1.destroy()- destroy all instances
instance1.destroyAll()Config
Warning
- If
rotateis in yourtransformor default mode is not good, setisLeftTop:truein your config.
Other Shiny Libs
TODO
- support npm
- support browser
- add tests
- support mobile touch behavior
- add readme config
- avoid overwrite transform other values