开发者

jQuery UI draggable event handling

开发者 https://www.devze.com 2023-03-18 10:31 出处:网络
I want t开发者_运维问答o stop the revert event on a draggable element if that element has been dropped on a valid droppable object. How do I stop the revert from happening?I\'m assuming by \"in the ri

I want t开发者_运维问答o stop the revert event on a draggable element if that element has been dropped on a valid droppable object. How do I stop the revert from happening?


I'm assuming by "in the right place" you mean a droppable element. If that's the case, just use the revert option, set to 'invalid':

$("#drag").draggable({
    revert: 'invalid'
});

Here's a working example: http://jsfiddle.net/wKBRk/

0

精彩评论

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

关注公众号