我正在使用 Alertify 库在我的 javascript 中创建一个对话框,
alertify.myAlert || alertify.dialog('myAlert',function factory(){
return {
main:function(content){
this.setContent(content);
},
setup:function(){
return {
options:{
modal:false,
basic:true,
maximizable:false,
resizable:false,
padding:false,
visible:false
}
};
},
hooks: {
onshow: function() {
this.elements.dialog.style.height = '50%';
this.elements.dialog.style.width = '15%';
}
}
};
});
并且,使用下面的代码调用它..
alertify.myAlert("my html content");
一旦启动,我该如何关闭它?我尝试了诸如 alertify.myAlert.close()、alertify.myAlert.hide() 之类的差异组合,但没有任何效果..