admin管理员组文章数量:1307764
Say I have 3 smiley faces, L, M and R at the top of a page. At the bottom, I have a destination box. Between them is a statement : "drag the Middle smiley to destination".
While draggable allows you to do that, it drags the actual element, not a copy. When the user drags a smiley face, I want the top 3 to remain stationary, with only a copy of the one theyre moving to actually move. The user should be able to drag multiple copies if needed into multiple destination boxes.
Basically, Im looking for something like this
$("#drag-target-1").draggable('leave-copy');
Say I have 3 smiley faces, L, M and R at the top of a page. At the bottom, I have a destination box. Between them is a statement : "drag the Middle smiley to destination".
While draggable allows you to do that, it drags the actual element, not a copy. When the user drags a smiley face, I want the top 3 to remain stationary, with only a copy of the one theyre moving to actually move. The user should be able to drag multiple copies if needed into multiple destination boxes.
Basically, Im looking for something like this
$("#drag-target-1").draggable('leave-copy');
Share
Improve this question
asked Sep 30, 2012 at 22:26
jasonjason
4,8019 gold badges40 silver badges46 bronze badges
2
- 1 Possible duplicates: stackoverflow./q/2458817/900747, stackoverflow./q/623703/900747, stackoverflow./q/5552083/900747 – A.M.K Commented Sep 30, 2012 at 22:29
- 1 jqueryui./demos/draggable/#option-helper – j08691 Commented Sep 30, 2012 at 22:32
1 Answer
Reset to default 9Use helper property with value clone
to enable cloning of draggable element.
$("#drag-target-1").draggable({helper : 'clone' });
本文标签: javascriptjquery draggable but leave copy where original element wasStack Overflow
版权声明:本文标题:javascript - jquery draggable but leave copy where original element was - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741828649a2399798.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论