我只是在写一些代码,但遇到了这样的问题:
alertify.dialog("confirm").set(
{
'labels':
{
ok: 'Personal',
cancel: 'Share'
},
'message': 'Select target:',
'onok': function()
{
alertify.confirm($("#dir_select_user").get(0), function()
{
var i = $("#dir_select_user .dir_selector").val();
t.find(".move_des").val(i);
t.find(".move_verify").val("1");
t.submit();
}).set('labels',
{
ok: alertify.defaults.glossary.ok,
cancel: alertify.defaults.glossary.cancel
});
},
'oncancel': function()
{
alertify.confirm($("#dir_select_share").get(0), function()
{
var i = $("#dir_select_share .dir_selector").val();
t.find(".move_des").val(i);
t.find(".move_verify").val("1");
t.submit();
}).set('labels',
{
ok: alertify.defaults.glossary.ok,
cancel: alertify.defaults.glossary.cancel
});
}
}) }).show();
我使用来自http://alertifyjs.comalertifyjs
的库(不是来自http://fabien-d.github.io/alertify.js/)。
如果您尝试此代码,您会发现“onok”和“oncancel”对话框在选择personal
或后很快消失share
。
这里有什么问题?我该如何解决?