id: 11885    nodeId: 11885    type: General    point: 39.0    linkPoint: 1.0    maker: cella    permission: linkable    made at: 2013.10.30 02:25    edited at: 2013.10.30 02:27
Javascript drag and drop in iOS7
First, I found that HTML5 drag and drop is convenient.
http://www.w3schools.com/html/html5_draganddrop.asp
But it's not supported in iOS7 as follows.
https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
In the same document, Apple says drag and drop can be implemented from the basic touch events following the tutorial of the following. But I can't find any clue in there.
https://developer.apple.com/library/safari/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/InteractiveControl/InteractiveControl.html#//apple_ref/doc/uid/TP40008032-CH16-SW7
After then, I searched and found some tips.
One is "create customized event" but I don't understand how his claim is to be true. (Anyway, createEvent() is deprecated. customEvent constructor is to be used instead.)
http://stackoverflow.com/questions/5186441/javascript-drag-and-drop-for-touch-devices
http://www.sitepoint.com/javascript-custom-events/
Another one is to use some libraries and I don't like that idea.
http://www.gotproject.com/blog/post2.html
https://github.com/timruffles/ios-html5-drag-drop-shim/blob/master/ios-drag-drop.js
And I looked through the source code of the above drag-and-drop-shim and found that there is a method document.elementFromPoint().
I guess that this method can be used to implement drag and drop.

Return to HTML 5.1 or Javascript drag and drop in iOS7