This project provide a function that make your target element can be dragged in your web page.
1.Import the drag.js
into your page.
2.Set the bar and target element.
<script type="text/javascript">
var bar = document.getElementById('bar'); //the element your mouse focus
var target = document.getElementById('target'); //the target element you want to drag
setDrag(bar, target);
</script>
example.html
provided an example of this script file.