HTML5 Drag & Drop for Mobile

后端 未结 3 1259
粉色の甜心
粉色の甜心 2021-01-03 07:15

This is my implementation of WHATWG HTML5 Drag and Drop:



        
相关标签:
3条回答
  • 2021-01-03 07:25

    I had the same need and wrote a polyfill that enables HTML5 drag/drop on mobile devices (Android and IOS):

    https://github.com/Bernardo-Castilho/dragdroptouch

    Hope this works for you.

    0 讨论(0)
  • 2021-01-03 07:30

    Since most of mobile browser still do not support HTML5 drag drop, so just in case some still looking solution, I have created a simple drag and drop that works in most of the mobile browser using Raphael. http://xtrace.blogspot.de/2013/01/simple-drag-and-drop-with-raphael.html

    0 讨论(0)
  • 2021-01-03 07:42

    Unfortunately Drag and Drop is not currently supported by any mobile browsers except Internet Explorer Mobile 10 onwards and a single deprecated Presto version of Opera (which has now been replaced by Webkit based versions). See http://caniuse.com/#feat=dragndrop

    The best solution would be to detect support for drag and drop (ensuring that this does not give you false positives in mobile versions of browsers that do support the API) and then use JavaScript to polyfill on mobile devices. This will also help provide support in legacy browser versions that pre-date native support for drag and drop.

    You can use the excellent YepNope conditional loading library to run the test and then conditionally load one or more scripts to provide JavaScript support for drag and drop, or you could use Modernizr to both carry out the test and load the scripts.

    0 讨论(0)
提交回复
热议问题