Drag’n’Drop algorithmdrag(d,w,string1,string2,string3)();
d (Obligatory):the element dragged.
w (Optional):Where to drag the element dragged.
string1,string2,string3 (Optional): the type of event ,("e:mousedown","e:mousemove","e:mouseup") is default.
On mousedown: -prepare the element for moving, if needed (maybe create a clone of it, add a class to it or whatever).
Then on mousemove move it by changing left/top with position:absolute or position:relative
On mouseup – perform all actions related to finishing the drag’n’drop.
drag(select('.dot'),"e:click","e:click","e:click")();
//Or drag(select('.dot'),"e:click|false","e:click|false","e:click|false")();
//false :is useCapture (true or false)
//Where to drag : body is default.
drag(select('.dot'),select('.whereToDrag'),"e:click","e:click","e:click")();
//Or drag(select('.dot'),select('.whereToDrag'),"e:click|false","e:click|false","e:click|false")();
//false :is useCapture (true or false)