dragover vs dragenter events of HTML5 drag & drop

The dragenter event happens at the moment you drag something in to the target element, and then it stops.
The dragover event happens during the time you are dragging something until you drop it.

Look here:

$('.dropzone').on("dragover", function (event) {
    console.log('dragover');
});
$('.dropzone').on("dragenter", function (event) {
    console.log('dragenter');
});

Now see the console:

enter image description here

As you can see the dragenter happen once (when you drag element in to the target).

But the dragover event happen every few hundred milliseconds.

The same difference exist between drag and dragstart, dragstart happen once but drag happen every few hundred milliseconds.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)