1.0.0 • Published 5 years ago
drag-chan v1.0.0
drag chan
A library to make HTML DOM elements draggable.
Install
yarn add drag-chanExample
<div class="box">
<div class="box-drag-handle"></div>
</div>import dragchan from 'drag-chan'
const box = document.querySelector('.box')
const boxDragHandle = document.querySelector('.box-drag-handle')
dragchan(box, boxDragHandle).box {
position: relative;
width: 100px;
height: 100px;
background: #ddd;
}
.box-drag-handle {
position: absolute;
width: 100%;
height: 17px;
background: #666;
cursor: move;
}1.0.0
5 years ago