Skip to content Skip to sidebar Skip to footer

Prevent Ghost Image On Dragging Non-draggable Elements?

I'm creating a website that utilizes the HTML5 Drag and Drop API. However, to increase the user experience, I'd like to prevent ghost images when a user drags non-draggable element

Solution 1:

This is the solution you're looking for. ;)

For anything that DOES need to be draggable, just add the 'enable-drag' CSS class.

$('*:not(".enable-drag")').on('dragstart', function (e) {
    e.preventDefault();
    return false;
});

Post a Comment for "Prevent Ghost Image On Dragging Non-draggable Elements?"