Is it better to use native drag and drop API or library?
-
I planed to design a game and it needs drag and drop. I have been experimenting with the native (HTML5) drag and drop API and (from 3-4 hours experimenting) it feels very limited in what it can do (or at least hard for me to get my head around) This came is something that I used to play as a kid and have not found any online version. So it is a fun personal project but one that I want to be able to brag about on my portfolio, so should I stick with the native API or find a drag and drop js library
-
Answer:
I always opt for library... Knowing someone dealt with all the edge cases (think 6+ browsers) is very comforting to reduce the "oh shit" moments that come from your clients using ie7. If you think you want to deal with it all, please contribute back after a few revisions to help others who may not want to deal with it. I've started multiple open source projects when i didnt find a good enough solution. It's all about karma.
Angel Grablev at Quora Visit the source
Other answers
I have the total opposite opinion as angel :) I only use libraries where they are really necessary to keep things clean (e.g. pushState router). However else I avoid using libraries as possible. I am not interested in compability and I disagree with some frameworks hiding a lot up (like Backbone, jQuery, Ember) and forcing you into an environment. At least in JavaScript it is really easy just to use single components and structure them together how you want. Want to change the template engine? Just update the package and update the render calls to the new lib. So back to the main question: No, I would not use a library as I am not interested in backwards compability. However if my app would take a huge use of for example the File API I would choose a small library to reduce overhead and code. var drop = require('drop'); var el = document.querySelector('#drop'); drop(el, function(e){ var items = e.items; items.forEach(function(item){ console.log(item); }); }); Source: https://github.com/component/drop
Bodo Kaiser
Related Q & A:
- Is it better to use many records in one table, or to use multiple tables?Best solution by Stack Overflow
- Is it better to use a tv as your computer monitor, or a computer monitor as a tv?Best solution by tomshardware.com
- What kind of camera would be better to use to make youtube videos?Best solution by Yahoo! Answers
- Is it better to use checking or savings in PayPal?Best solution by Yahoo! Answers
- Which cellphone is much better to use?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.