简体   繁体   English

jQuery UI对话框的不同动画是否根据按钮而关闭?

[英]Different animations for jQuery UI dialog close depending on button?

Is it possible (in a reasonalbe way) to have a jQuery UI dialog closed with different animations depending on which button that is clicked? 是否有可能(以合理的方式)根据单击的哪个按钮关闭带有不同动画的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");
        }
    }
});

Yep. 是的

$( "#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");
        }
    }
});

Live example: http://jsfiddle.net/GLUHa/2/ 实时示例: http//jsfiddle.net/GLUHa/2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM