Can someone please explain to me how the drag and drop API works. | SoloLearn: Learn to code for FREE!

+15

Can someone please explain to me how the drag and drop API works.

If you can, share a code showing it.

7/8/2017 10:36:28 PM

Kabulput

10 Answers

New Answer

+5

You can achieve that by First setting the boolean draggable to "true", though it may be true by default. eg: <div id="div1" draggable="true"> then the JavaScript code for the ondrag event function. ...I'll be making a code for this.

+14

Thank you, looking forward to the code.

+12

Thank you guys 😃

+6

I have been playing with this couple of days ago, with html5 touch events for touchscreens and vanilla JS(no library), just made couple of changes. Ok here check it out: https://code.sololearn.com/Wdhhd3yG5Z7l/?ref=app

+6

@Visph, maybe that's because of your disapproving words against him ("Mmmm... Where is the code to study?") ...you don't need to find faults on someone's post only give your own suggestions and leave the rest to the asker. @Calvin, I don't think it's a good motivation to leave the Q/A, just forget about this, dude! 😎

+6

My examination is near. Can't Q&A later.

+5

Here the code you could study... https://code.sololearn.com/WgZg39ucD3l4/?ref=app

+5

Thank you @visph for all the clarifications. ;P Happy coding, everyone. Calvin is signing off from Q&A here.

+4

@Calvin wrote: << Here the code you could study... >> Mmmm... Where is the code to study? You use only four lines of JS and the 'slip.js' library as linked file ;P @Muhammad S U: Here is the github project you could study... https://github.com/pornel/slip And here the original demo page: https://kornel.ski/slip/

+3

@Calvin wrote: << Calvin is signing off from Q&A here. >> Why signing off? Can we be complementary all together in our answers? ;)