function startDrag(e) {
      e.preventDefault();

      //Set the start click position
      clickPosX = e.clientX;
      clickPosY = e.clientY;

      // Attach the drag events
      document.onmouseup = endDrag;
      document.onmousemove = drag;
   }
// Function that is call when dragging
Function that is call when dragging
Function that is call when dragging
function startDrag(e) {
      e.preventDefault();
      clickPosX = e.clientX;
      clickPosY = e.clientY;
      document.onmouseup = endDrag;
      document.onmousemove = drag;
   }
function startDrag ( e ) { e . preventDefault ( ) ; clickPosX = e . clientX ; clickPosY = e . clientY ; document . onmouseup = endDrag ; document . onmousemove = drag ; }
Function that is call when dragging
Function that is call when dragging
//Set the start click position // Attach the drag events