jquery - JAVASCRIPT drag-and-drop from browser to desktop using TOUCH events? -


i'm working on website, supposed allow user drag , drop div containing html canvas offscreen. div made draggable jquery's .draggable() function, this:

div_to_drag.draggable({     //some .draggable() properties }) 

note: jquery .draggable api can found here: http://api.jqueryui.com/draggable/

when user begins dragging div containing canvas off screen, convert canavs image, , save image desktop when user drops. instead of using mouse, user drags div offscreen using touch screen. touch capabilities enabled magictouch.js. here's code handles when user begins dragging:

div_to_drag[0].addeventlistener('touchstart', function (event) {     // if 2 fingers inside div, user dragging div     if (event.targettouches.length == 2) {         //convert canvas inside div image         //get datatransfer property of event , attach image     } }, false); 

note: magictouch.js follows w3c standards, defined here: https://dvcs.w3.org/hg/webevents/raw-file/tip/touchevents.html#dfn-touchend

now, problem drag , drop off screen, seems way "datatransfer" property of html5, created browser during html5 drag events. how datatransfer property touch events of magictouch.js? i've tried programatically creating html5 drag events, generates null datatransfer property, explained older post:

datatransfer null when creating drag event programmatically

so, because of security, can't manually create datatransfer property during touchstart. datatransfer way i'll able allow user drag , drop desktop. there way can generate valid datatransfer property when using touch events? appreciated


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -