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?
Because, first the cloned element have to inserted into the DOM and then should be animated.
var newElement=$('.oggetto').eq(0).clone();
$("#container").append(newElement); //add the element
//Now animate
newElement.animate({ 'top': '2000px'}, 5000);