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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access