It seems that my attempt at trying to replicate Jquery UI’s draggable function has proven the Quantum Mechanics principle of a div existing in two places at once.
When I hold my mouse down on the box div and move the mouse cursor, the box div starts flashing like crazy and a “clone” of the box div appears to the southeast of the original box div and it is also flashing.
Here’s the jsfiddle:
I have fixed your jsfiddle, give it a go now:
http://jsfiddle.net/5Sxrq/2/
The issues were:
if you want to use margins then you’ll have to subtract it from offsets
You should get
mouseOffXandmouseOffYwhenmousedownevent was called, not every time withmousemoveEDIT:
this one is with fixed margin issues:
http://jsfiddle.net/5Sxrq/3/