From the course: JavaScript: Events

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Dragging and dropping

Dragging and dropping - JavaScript Tutorial

From the course: JavaScript: Events

Start my 1-month free trial

Dragging and dropping

So we still have a long way to go on this project but we started to allow the user to drag elements on the page by listening to the drag start event. So this is really not letting you move anything but at least it's tracking the beginning of a move so we need to continue with this. Now before we do that, I wanted to talk to you about the different events that are available for dragging. And this is a really good article to read about all of the different events available to you when you're dragging things. So you can see that we have a drag start event, a drag event, drag enter, drag leave. Drag over, drop, and drag in. We're only really going to use a few of these in our project but take a look at this page to read more about some of these different elements. They're really designed to let you drag one thing onto another element. So if you look at the finished version of this, think it's somewhere down here, you can drag one item into another one. Let's see. There you go, like that…

Contents