Mercurial Hosting > dad
comparison src/alternatives/interactjs.html @ 3:6d5e4b38b4fb
start drag
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 21 Apr 2023 00:58:31 -0600 |
parents | 9c372fce698a |
children | eee8862be4c7 |
comparison
equal
deleted
inserted
replaced
2:264646feb67b | 3:6d5e4b38b4fb |
---|---|
41 } | 41 } |
42 return -1; | 42 return -1; |
43 } | 43 } |
44 | 44 |
45 function dragEnterListener(event) { | 45 function dragEnterListener(event) { |
46 //return; | |
46 console.log(event); | 47 console.log(event); |
47 let entered = event.target; | 48 let entered = event.target; |
48 let dragging = event.relatedTarget; | 49 let dragging = event.relatedTarget; |
49 if( entered === dragging ) | 50 if( entered === dragging ) |
50 return; | 51 return; |
66 } | 67 } |
67 | 68 |
68 function init() { | 69 function init() { |
69 let dad = interact('div[drag]'); | 70 let dad = interact('div[drag]'); |
70 dad.draggable({ | 71 dad.draggable({ |
72 autoScroll: true, | |
71 listeners: { | 73 listeners: { |
72 start: dragStartListener, | 74 start: dragStartListener, |
73 move: dragMoveListener, | 75 move: dragMoveListener, |
74 end: dragEndListener, | 76 end: dragEndListener, |
75 } | 77 } |