2012-05-08 12 views
0

クリックしたボタンに応じて異なるアニメーションでjQuery UIダイアログを閉じることは(合理的な方法で)可能ですか?ボタンに応じてjQuery UIダイアログが閉じるアニメーションが異なる?

$("#dialog").dialog({ 
    autoOpen: false, 
    show: "blind", 
    hide: "explode" 
    buttons: { 
     "Delete": function() { 
      ... one animation here ... 
      $(this).dialog("close"); 
     }, 
     "Cancel" : function() { 
      ... another here ... 
      $(this).dialog("close"); 
     } 
    } 
}); 

答えて

3

イエップ。

$("#dialog").dialog({ 
    //autoOpen: false, 
    show: 'blind', 
    buttons: { 
     Delete: function() { 
      $(this).dialog('option', 'hide', 'explode'); 
      $(this).dialog("close"); 
     }, 
     Cancel : function() { 
      $(this).dialog('option', 'hide', 'blind'); 
      $(this).dialog("close"); 
     } 
    } 
}); 

ライブ例:http://jsfiddle.net/GLUHa/2/

関連する問題