santa
santa

Reputation: 12512

JS library (with drag n drop) compatible with iOS and regular browsers

Does anyone know of a JS framework that has drag and drop functionality and is compatible with mobile (iOS) and regular browsers?

I currently have a web-based app and it is a hassle to make its drag'n'drop functionality work on iOS... I wish there was one that would do it for both...

Upvotes: 57

Views: 9257

Answers (13)

taye
taye

Reputation: 281

interact.js is a standalone and lightweight drag-and-drop, resize and multi-touch gesture javascript module. It works on iOS, Android, Chrome, Firefox, Opera and IE9+ with support for interacting with HTML and SVG elements. Something to note in advance is that it's up to the developer to respond to drag events but I think that's a good thing.

To allow the whole page to be panned by dragging, you could use:

// make an Interactable of the document body element
interact(document.body)
// make a draggable of the Interactable
  .draggable({
    // on(drag)move
    onmove: function (event) {
      x += event.dx;
      y += event.dy;

      // translate the document body by the change in pointer position
      document.body.style.translate = 'translate(' + x + 'px, ' + y + 'px)';
    }
  })

Upvotes: 4

defau1t
defau1t

Reputation: 10619

You can use jquery UI for drag and drop and an additional library that maps touch events to their mouse event analogs.I think this should solve your problem:

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

To add touch events, just include the jquery.ui.touch-punch.min.js script after your jquery.ui scripts.

DEMOS:

http://furf.com/exp/touch-punch/

Upvotes: 2

austincheney
austincheney

Reputation: 1115

This is still in alpha: http://prettydiff.com/jsgui

It is persistent even after you close or refresh your browser and it will work in any modern browser. Furthermore it is not a framework. You can use this without other frameworks and you can customize it to do what you want.

Upvotes: 0

Elmer
Elmer

Reputation: 9437

hi there i use this jquery plugin: https://github.com/LuvDaSun/jdrag

It provides some drag events

let me know if you find any bugs, the code is quite new!

Upvotes: 0

Nick Nizovtsev
Nick Nizovtsev

Reputation: 373

  • zepto (smallest, iOS 4+, Android 2.2+, webOS 1.4.5+)
  • jquery, jquerymobile, jqtouch
  • prototype
  • sencha, senchatouch

Upvotes: 2

Tudor
Tudor

Reputation: 4164

http://www.kendoui.com/ this should work. Has d'n'd too, even though it's still in Beta.

Upvotes: 3

Adilson de Almeida Jr
Adilson de Almeida Jr

Reputation: 2755

If you are building web apps for ios you must try jquery mobile.

Upvotes: 0

Filip Radelic
Filip Radelic

Reputation: 26683

Check out SproutCore. It's a framework created by former Apple engineers and is used by Apple in MobileMe and iCloud web apps. It has SC.Drag which works with both mouse and touch events.

Upvotes: 6

NT3RP
NT3RP

Reputation: 15370

I'm not sure if its exactly what you're looking for, but you could try PhoneGap or maybe XUI.

Upvotes: 0

Nicolas Modrzyk
Nicolas Modrzyk

Reputation: 14197

JQuery Mobile is trying to support a large variety of platforms

And here is a specific plugins for Drag and Drop

Upvotes: 10

Brombomb
Brombomb

Reputation: 7076

Here's two built in jQuery:

http://www.stevefenton.co.uk/cmsfiles/assets/File/mobiledragdrop.html

http://code.google.com/p/jquery-ui-for-ipad-and-iphone/

There is also the jquery mobile framework (which does not have drag and drop nativly): http://jquerymobile.com/

Upvotes: 27

hbhakhra
hbhakhra

Reputation: 4236

Try dojo. It works pretty well and it is a relatively mature toolkit. http://dojotoolkit.org/

Upvotes: 8

James Hill
James Hill

Reputation: 61802

I'm a big fan of Sencha Touch.

Here's there drag and drop demo - http://dev.sencha.com/deploy/touch/examples/dragdrop/.

Note: Tested on my iPhone 4 in Safari.

Upvotes: 14

Related Questions