.md {
position: fixed;
left: 14px;
top: 14px;
width: 250px;
text-align: center;
}
.mdtop {
background: green;
color: white;
display: grid;
grid-template-columns: repeat(3, 1fr);
}
.mdtopmove {
border-left: 2px solid white;
border-right: 2px solid white;
cursor: cell;
}
.mdbody {
height: 45px;
background: #eee;
margin-top: 3px;
border: 2px solid blue;
}
<div class='md' draggable='true'>
<div class='mdtop'>
<div class='mdtopclose'>CLOSE</div>
<div class='mdtopmove'>MOVE</div>
<div class='mdtopsave'>SAVE</div>
</div>
<div class='mdbody'>BODY</div>
</div>
I'm trying to make .md
horizontally draggable without using jquery ui
, just using HTML5 API.
There is draggable = 'true'
but what else should I do?
handle should be mdtopmove
.
Any help?