Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advantages of HTML 5 Drag and Drop over jQuery UI Drag and Drop

I'm writing a new web application that needs to support drag and drop operations for elements on the page (not file drag and drop).

This the answer to this question

html5 vs jquery drag and drop

recommends using Modernizr to check whether the browser supports HTML5 drag and drop and either use that support or fall back to an alternative like jQuery UI.

Since they have quite different models, that means that all drag and drop code would have to be implemented and tested separately (very little shared implementation). It only seems logical to do that if there are significant, user-impacting benefits to HTML5 drag and drop and if the fallback to jQuery UI would provide a degraded experience.

Are there significant benefits to implementing both variants?

like image 248
Eric J. Avatar asked Mar 01 '12 21:03

Eric J.


People also ask

What is the importance of drag-and-drop in HTML5?

Drag and Drop (DnD) is powerful User Interface concept which makes it easy to copy, reorder and deletion of items with the help of mouse clicks. This allows the user to click and hold the mouse button down over an element, drag it to another location, and release the mouse button to drop the element there.

How do you drag-and-drop in jQuery?

Using jQuery UI, we can make the DOM(Document Object Model) elements to drag anywhere within the view port. This can be done by clicking on the draggable object by mouse and dragging it anywhere within the view port. If the value of this option is set to false, it will prevent the DOM elements to be dragged .

How does drag-and-drop work in JavaScript?

Introduction to JavaScript Drag and Drop APITo drag an image, you simply hold the mouse button down and then move it. To drag the text, you need to highlight some text and drag it in the same way as you would drag an image.


2 Answers

I would guess that eventually jQuery will take advantage of built-in browser capabilities like html 5 drag and drop.

And if different browsers implement it differently...jQuery will deal with it.

like image 127
Steve Wellens Avatar answered Sep 19 '22 09:09

Steve Wellens


I think the biggest advantage to HTML5 drag and drop over jQuery is the elimination of the sizable jQuery UI library and css files.

That being said, there is the current issue of browser compatibility that makes jQuery very much needed.

like image 43
Todd Moses Avatar answered Sep 23 '22 09:09

Todd Moses