docs: function dragElement(el, events) {
  
    function getPointer(e) {
      var x = 'clientX';
      var y = 'clientY';
      var evt = e.touches ? e.touches[0] : e;
      return { x: evt[x], y: evt[y] };
    }
  
    var drag = { x: 0, y: 0, deltaX: 0, deltaY: 0, active: true, events: events || {} };
    var originalX = 0;
    var originalY = 0;
    var pointerX = 0;
    var pointerY = 0;
  
    function move(e) {
      if (drag.active) return;
      drag.deltaX = pointerX - getPointer(e).x;
      drag.deltaY = pointerY - getPointer(e).y;
      drag.x = originalX - drag.deltaX;
      drag.y = originalY - drag.deltaY;
      if (drag.events.move) drag.events.move(drag);
    }
  
    function release(e) {
      drag.active = true;
      if (drag.events.release) drag.events.release(drag);
      document.removeEventListener('mousemove', move, false);
      document.removeEventListener('mouseup', release, false);
      document.removeEventListener('touchmove', move, false);
      document.removeEventListener('touchend', release, false);
    }
  
    function start(e) {
      if (!drag.active) return;
      e.preventDefault();
      drag.active = false;
      pointerX = getPointer(e).x;
      pointerY = getPointer(e).y;
      originalX = drag.x;
      originalY = drag.y;
      if (drag.events.begin) drag.events.begin(drag);
      document.addEventListener('mousemove', move, false);
      document.addEventListener('mouseup', release, false);
      document.addEventListener('touchmove', move, false);
      document.addEventListener('touchend', release, false);
    }
  
    el.addEventListener('mousedown', start, false);
    el.addEventListener('touchstart', start, false);
  
    return drag;
  
  }