简体   繁体   English

拖放PhoneGap和Jquery Mobile

[英]Drag and drop in PhoneGap and Jquery Mobile

I searched around thread and I found out to drag and drop in mobile need to use Jquery UI and use prevent default to do it but mine don't works. 我在线程周围搜索,发现拖放移动需要使用Jquery UI并使用prevent default来做到这一点,但我的行不通。 I tried UI touch punch it still won't work either and I not sure which step I have been missing out. 我尝试过UI触控打孔,但仍然无法正常工作,我不确定我错过了哪一步。 My screen in mobile is drag up and down and sometimes get miss a drag action from LogCat. 我在手机上的屏幕是上下拖动,有时会错过LogCat的拖动操作。

<script type="text/javascript" src="cordova-1.7.0.js"></script>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>

JS File JS文件

 $( document ).delegate("#game", "pageshow", function() {
  $('.box0').draggable();
  $('.box1').draggable();
  $('.box2').draggable();
  $('body>div').bind("dragstart", function(event, ui){
      event.stopPropagation();
  });
});

Maybe you can see this http://forresst.github.com/2012/06/22/Make-a-list-jQuery-Mobile-sortable-by-drag-and-drop/ 也许您可以看到此http://forresst.github.com/2012/06/22/Make-a-list-jQuery-Mobile-sortable-by-drag-and-drop/

I don't know if it works on PhoneGap 我不知道它是否可以在PhoneGap上使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM