餘米創建使用Alertify庫我的JavaScript對話框,如何關閉alertify.dialog
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");
一旦推出,我怎麼能關閉它? 我試圖DIFF組合像alertify.myAlert.close(),alertify.myAlert.hide(),但沒有奏效..
使用無參數構造函數來獲取對話框引用,然後關閉()它alertify.myAlert()。close()' –