I am trying to clone an element with jQuery and then animate it. The source element has an image that has already been uploaded and shown before cloning. However, in the cloned element, the image shows only half of the animation path.
Here is the html of the clone element:
<div class='item'> <div class='picture'><img src='img/picture1.jpg'></div> <h3>Item</h3> <p class='price'>$25</p> <div class='desc'>Image description...</div> </div>
And jQuery which I use for cloning:
itemObject = $(".item"); // Code has proper selector to choose appropriate item newItemObject = itemObject.clone() // Overlay new object over original object newItemObject.appendTo('#main').css({ 'position': 'absolute', 'top': itemObject.offset().top, 'left': itemObject.offset().left }); // Do animation on newItemObject...
Is this something that always happens when cloning elements with images? Is there something wrong with what I'm doing? How can i fix this?
source share