jQuery – draggable images on iPad / iPhone – how to integrate event.preventDefault();?

Try this library

https://github.com/furf/jquery-ui-touch-punch

Just follow these simple steps to enable touch events in your jQuery
UI app:

  1. Include jQuery and jQuery UI on your page.

    <script src="http://code.jquery.com/jquery.min.js"></script>
    <script src="http://code.jquery.com/ui/1.8.17/jquery-ui.min.js"></script>
    
  2. Include Touch Punch after jQuery UI and before its first use.

    Please note that if you are using jQuery UI’s components, Touch Punch must be included after jquery.ui.mouse.js, as Touch Punch
    modifies its behavior.

    <script src="https://stackoverflow.com/questions/4488601/jquery.ui.touch-punch.min.js"></script>
    
  3. There is no 3. Just use jQuery UI as expected and watch it work at the touch of a finger.

    <script>$('#widget').draggable();</script>
    

Leave a Comment