enabling drag and drop on a touchscreen mobile device

danwoods picture danwoods · Jan 9, 2010 · Viewed 34.3k times · Source

I just recently got an android phone and found that the drag and drop on my site doesn't work! I understand why it wouldn't, but has anyone found a solution to this? I'm using JQuery to implement the D & D...

Answer

Jonathan Tonge picture Jonathan Tonge · Oct 2, 2012

I used jQuery UI touch punch - it works by hacking the mousedown, mouseup features and replaces them with touchstart, touchend etc.

ABOUT: http://touchpunch.furf.com/

SCRIPT: https://raw.github.com/furf/jquery-ui-touch-punch/master/jquery.ui.touch-punch.min.js

CODE:

include:

<script src="jquery.ui.touch-punch.min.js"></script>

after your jquery UI script file in your header.