user2224868
user2224868

Reputation: 1

Drag and Drop Function

I have two boxes and both can be used for drag and drop events. I have to highlight only one box at a time where drop function needs to be happen

Upvotes: 0

Views: 150

Answers (1)

Halcyon
Halcyon

Reputation: 57709

Detect when a drag event occurs on the document. Like:

$(document).on("dragstart", ..);

Then add a class to the box that you want to highlight:

$("#drop_box").addClass("highlight");

Then also remeber to remove the class again on "dragend"

Upvotes: 1

Related Questions