当我点击#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');
});
答案 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