代码之家  ›  专栏  ›  技术社区  ›  Dejell

ipad拖放

  •  12
  • Dejell  · 技术社区  · 16 年前

    我尝试了这个解决方案: http://www.gotproject.com/blog/post2.html

    但由于我自己也在使用JQuery,所以它冲突并且不起作用。

    如何在IPad上使用JQuery拖放?

    6 回复  |  直到 16 年前
        1
  •  5
  •   Michael Angstadt    13 年前

    如果您不使用jqueryui,请使用我创建的fork https://github.com/mikeangstadt/jquery-ui-touch-punch.git

    在iOS6上运行良好,没有在Android或其他系统上测试过。

        2
  •  18
  •   Mandeep Pasbola    14 年前

    工作:

    首先,使用jqueryui http://jqueryui.com/demos/ 用于拖放功能

    然后添加这个脚本 https://github.com/furf/jquery-ui-touch-punch 在Ipad或Iphone中播放。

        3
  •  3
  •   Tori Marrama    15 年前
        4
  •  2
  •   doctorme    14 年前

    确认furf的jquery ui touch punch可以在iPad上使用。

    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>
    

    //
    // 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 ();
    }
    

    现在“item”既可以在ipad的屏幕上拖动,也可以在桌面的chrome中拖动。

        5
  •  2
  •   Eric Leschinski Mr. Napik    9 年前

    https://developer.apple.com/library/content/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/multitouch_background/multitouch_background.html

    这是苹果的官方指南,介绍了如何使用UIKit中的标准控件和手势识别器处理几乎所有的触摸事件。

        6
  •  0
  •   Youry    12 年前