eXos
eXos

Reputation: 15

jQuery UI sortable - Change CSS class while dragging over specific element

I'm searching for a possibility to change the CSS class of an element in a sortable jQuery list while dragging over a specific element. For example if I drag an element of a sortable list over a specific layer, the dragging layer should change the background color but still stay in the dragging mode.

Does anybody know if and how that could be done?

Upvotes: 1

Views: 1581

Answers (1)

Peter Smeekens
Peter Smeekens

Reputation: 664

You could use the 'over' event:

$( ".selector" ).sortable({
   over: function(event, ui) { ... }
});

http://jqueryui.com/demos/sortable/#event-over

Upvotes: 1

Related Questions