ipad drag and drop

后端 未结 6 1656
误落风尘
误落风尘 2021-01-31 12:09

I need to implement drag and drop for Ipad.

I tried this solution: http://www.gotproject.com/blog/post2.html

But since I am using JQuery myself, it conflicts and

相关标签:
6条回答
  • 2021-01-31 12:31

    If you aren't using jQuery UI, use the fork I created https://github.com/mikeangstadt/jquery-ui-touch-punch.git to hook up touch handler's using jQuery by firing the already defined mouse events.

    Works well on iOS6, haven't tested for Android or others.

    0 讨论(0)
  • 2021-01-31 12:45

    Apple has a Section called "Handling Multi-Touch Events" here: https://developer.apple.com/library/content/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/multitouch_background/multitouch_background.html

    It is the official Apple guide on how you can handle almost all of your touch events with the standard controls and gesture recognizers in UIKit.

    0 讨论(0)
  • 2021-01-31 12:47

    Working :

    Firstly, use jquery UI http://jqueryui.com/demos/ for drag and drop functionality

    and then add this script https://github.com/furf/jquery-ui-touch-punch for playing it in Ipad or Iphone.

    Hope it helps.

    0 讨论(0)
  • 2021-01-31 12:51

    Confirmed that furf's jquery-ui-touch-punch works on the iPad.

    Getting it to work is as easy as including "jquery.ui.touch-punch.js" after you've included jquery-ui and jquery itself. For example:

    HTML:

    <head>
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
    
        <!-- touch capability for tablets/phones -->
        <script type="text/javascript" src="js/jquery.ui.touch-punch.js"></script>
    </head>
    

    Javascript:

    //
    // assume that html_string is a valid string
    // containing some element you want to be draggable
    // which needs to be added to the DOM
    //
    function addItemToUIList (list, html_string) {
        var item = $(list).append (html_string);
    
        // now, using jqui and touch-punch, we can make it draggable
        item.draggable ();
    }
    

    Now "item" can be dragged around on screen on the ipad as well as in chrome on the desktop.

    0 讨论(0)
  • 2021-01-31 12:56

    This looked decent.

    http://popdevelop.com/2010/08/touching-the-web/

    0 讨论(0)
  • 2021-01-31 12:56

    I have worked on a fix to this issue check my github: https://github.com/youryss/fixdragtablet

    I hope it works for you

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