[英]Different animations for jQuery UI dialog close depending on button?
是否有可能(以合理的方式)根據單擊的哪個按鈕關閉帶有不同動畫的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");
}
}
});
是的
$( "#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/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.