Chapter 7. Dragging and Dropping

Dojo has built-in support for one of the most elegant Web page features: drag and drop. You might think that letting users drag and drop elements in your Web pages should be simple, but you’ll find that it isn’t if you write all the code yourself. After accounting for cross-browser issues, you’ll be writing about five single-spaced pages of JavaScript code.

Dojo, the cross-platform JavaScript toolkit, to the rescue! Dojo has lots of drag-and-drop capability built in, and all you need to do is put it to work—which can be as easy as making the dojoType value of an element dojo.dnd.Moveable (the dnd stands for drag and drop).

In this chapter, you’ll see how to add drag-and-drop capability to your Web pages, from supporting ...

Get The Dojo Toolkit: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.