2014-10-11 24 views
0

當我點擊#Clonitdiv我在#result中得到一個克隆。我需要做什麼CSS動畫從#container#result動畫製作小工具的克隆到另一個div上點擊

另外,任何人都可以請告訴我爲什麼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

回答

0

我已經在你的代碼中加入這一行。檢查它removeAttr像魅力一樣工作。你需要什麼。更加詳細一些。

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