O'Reilly logo

HTML5 Multimedia Developer's Guide by Lee Cottrell, Ken Bluttman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8Drag-and-Drop: Moving Things Around the Screen

The drag-and-drop technology of HTML5 offers ways to take interesting ideas and make them real. For example, can you really put a square peg in a round hole? Probably so with drag-and-drop.

Drag-and-drop works by identifying two types of items: ones that can be dragged and ones that can accept something being dropped on them. A number of events are in play when dragging and dropping happens. Essentially, you provide an attribute to an item (a div, an image, and so on) that makes it draggable. Other elements are set to accept the drop. In other words, a draggable element is dragged to a drop-enabled element.

Along the way in this process are events for when the dragging starts, when the dragging ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required