Update '12/dragable.js'

master
murtaugh 5 years ago
parent bdc1ff8f91
commit d729f5f3d3

@ -1,8 +1,8 @@
function makeDragable(dragHandle, dragTarget) { function makeDragable(dragHandle, dragTarget) {
let dragObj = null; //object to be moved var dragObj = null; //object to be moved
let xOffset = 0; //used to prevent dragged object jumping to mouse location var xOffset = 0; //used to prevent dragged object jumping to mouse location
let yOffset = 0; var yOffset = 0;
document.querySelector(dragHandle).addEventListener("mousedown", startDrag, true); document.querySelector(dragHandle).addEventListener("mousedown", startDrag, true);
document.querySelector(dragHandle).addEventListener("touchstart", startDrag, true); document.querySelector(dragHandle).addEventListener("touchstart", startDrag, true);

Loading…
Cancel
Save