I have clone and remove functions on my page, to which I want to apply slideDown / slideUp animations to respectively:
$('#add-item').click(function(){
var divCloned = $('.form-fields:first').clone();
divCloned.insertAfter('.form-fields:last');
return false;
});
$('.remove').live('click', function(){
if(confirm("Are you sure you wish to remove this item?"))
{
$(this).parent().remove();
}
return false;
});
I have tried doing this but either it doesn’t work or the animation is very jerky. Anyone know how this can be done?
for the cloning
and for the removing
Demo at http://www.jsfiddle.net/gaby/qf4j3/