Ich möchte den Dialog in, aber variieren Sie die Animation abhängig davon, ob die OK oder die Schaltfläche Abbrechen gedrückt wird. Wenn die OK-Taste gedrückt wird, möchte ich FadeOut, sonst Explode.JQuery UI: Für Modal, wollen verschiedene Animationen, wenn OK vs Abbrechen Schaltfläche gedrückt wird
Können Sie mir helfen, meinen vorhandenen Code zu ändern, um dies zu tun?
function confirmCancelReadyToRun(link, vendorId, runYearMonthDate, runYearMonthDisplay) {
var $myDialog = $("<div></div>")
.html("Are you sure that you want to Cancel the Ready to Run for Vendor ID " + vendorId + " on " + runYearMonthDisplay + "?")
.dialog({
modal: true,
autoOpen: false,
show: "fade",
title: "Confirm Cancel",
my: "center",
at: "center",
of: window,
buttons: {
"Cancel": function() {
$(this).dialog("close");
return false;
},
"OK": function() {
$(this).dialog("close");
var form = $(link).parents("form:first");
var actionString = encodeURI(CorrectUrl("/ReadyToRun/CancelReadyToRun?vendorId=" + vendorId + "&runYearMonthDate=" + runYearMonthDate));
form.attr("action", actionString);
form[0].submit();
return true;
}
}
});
$myDialog.dialog("open");
}