June 28, 2012
Why can't I animate a cloned element?
Question by markzzz
This is my code :
var newElement=$('.oggetto').eq(0).clone();
newElement.animate({ 'top': '2000px'}, 5000);
<div id="container">
<div class="oggetto" style="left:0px;"> </div>
<div class="oggetto" style="left:50px;"> </div>
</div>
but seems that “.oggetto” won’t to move after the clone().
In fact, if I just write :
$('.oggetto').eq(0).animate({ 'top': '2000px'}, 5000);
it works as well. Where am I wrong?