开发者

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

开发者 https://www.devze.com 2023-02-19 00:41 出处:网络
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 spec

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 any开发者_运维问答body know if and how that could be done?


You could use the 'over' event:

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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消