开发者

How to connect to arbitary DOM elements using draggable in jQuery?

开发者 https://www.devze.com 2022-12-18 20:26 出处:网络
I\'ve found a article that explains how to connect draggable elements to sortable ones: http://the-stickman.com/files/jquery/draggable-sortable.html

I've found a article that explains how to connect draggable elements to sortable ones:

http://the-stickman.com/files/jquery/draggable-sortable.html

But what I need is to connect draggable elements to arbitary DOM elements,

I need to do something when I drop it on some e开发者_开发问答lement.

But how know the element that the draggable is on when I drop it?


Create a droppable, and use $(this) inside the ondrop function you set to refer to the droppable, and then do the connection.

http://jqueryui.com/demos/droppable/#event-drop

I believe that should do it, unless I misunderstand your problem.

0

精彩评论

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