2011-01-11 1 views
1

を削除しますアニメーションが非常にぎくしゃくしています。誰でもこれがどうやって行えるか知っていますか?クローニングは、私はクローンを持っているし、私のページに機能を削除し、その私が、それぞれにslideDown/slideUpアニメーションを適用するために、クローンにアニメーションを適用し、機能

$('#add-item').click(function(){ 
    var divCloned = $('.form-fields:first').clone(); 
    // first we hide it (set display to none), then we add it in the DOM 
    // and lastly we aninmate it with slideDown 
    divCloned.hide().insertAfter('.form-fields:last').slideDown('fast'); 
    return false; 
}); 

ため

答えて

5

とこれは完璧に動作しhttp://www.jsfiddle.net/gaby/qf4j3/

+0

で削除

$('.remove').live('click', function(){ if(confirm("Are you sure you wish to remove this item?")) { // we use the callback method of the slideUp function // so that the removal happens after the animation.. $(this).parent().slideUp('fast',function(){ $(this).remove(); }); } return false; }); 

デモのために、あなたの男をありがとう! – GSTAR

関連する問題