开发者

How to know the dragging element is over which element?

开发者 https://www.devze.com 2023-01-26 12:09 出处:网络
I have a problem with jQuery Drag&Drop. I have a draggable element and lots of dropTarget so I just want to k开发者_Python百科now when I am dragging, my dragging element is over which element?

I have a problem with jQuery Drag&Drop. I have a draggable element and lots of dropTarget so I just want to k开发者_Python百科now when I am dragging, my dragging element is over which element?

Btw, Firefox provides event.originalTarget that points an DOM Element but it is equal to "undefined" in Google Chrome.

Any suggestion?

Thanks.


Check out the over event on your droppables.

$('#droppableid').droppable({
    over: function(event, ui) {
        log('You are over item with id ' + this.id);
    }
});

Example here.

0

精彩评论

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

关注公众号