单击时将窗口小部件的动画克隆到另一个div

时间:2014-10-11 01:45:12

标签: jquery

当我点击#Clonit div时,我会在#result中获得克隆。我需要使用什么CSS来动画从#container#result的明显移动?

另外,有人可以告诉我为什么removeAttr功能不起作用吗?

html: -

<div id="container">
    <div id="Clonit">Click me and I copy to another place</div>
    <br /><br /><br /><br />
</div>

<div id="result"></div>

jquery: -

$("#Clonit").click(function() {
  $("#result").append($("#Clonit").clone(true));
  $("#result > #Clonit").removeAttr('id');
});

fiddle

2 个答案:

答案 0 :(得分:0)

我已在您的代码中添加此行。检查一下removeAttr就像魅力一样。你需要什么更具体。

$("#Clonit").click(function() {
    $("#result").append($("#Clonit").clone(true));
    $("#result > #Clonit").removeAttr('id');
    alert($("#result").html());
});

答案 1 :(得分:0)

我通过恢复使用drag解决了这个问题。在http://threedubmedia.com/code/event/drag#demos

查看一些非常有用的资源
相关问题