shoujo_sm
shoujo_sm

Reputation: 3203

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. I tried UI touch punch it still won't work either and I not sure which step I have been missing out. My screen in mobile is drag up and down and sometimes get miss a drag action from 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

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

Upvotes: 0

Views: 4060

Answers (1)

Forresst
Forresst

Reputation: 11

Maybe you can see this 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

Upvotes: 1

Related Questions