我正在使用Ionic和Cordova构建一个应用程序,当我单击ok时,alertify消息看起来很好,但没有关闭。我试图添加onocclick函数来尝试解决这个问题,但这并没有起到任何作用。下面是我的代码:
if (($scope.loginData.username==undefined)&&($scope.loginData.password==undefined)){
alertify.alert("You have not entered a username and a password.");
return;
}
else if ($scope.loginData.username==undefined){
alertify.alert("You have not entered a username.").set('label', 'Ok');
return;
}
else if ($scope.loginData.password==undefined){
alertify.alert("You have not entered a password.");
return;
}发布于 2015-11-08 21:43:45
我想你可能错过了onok方法
'onok': function(){ alertify.success('Great');}请考虑签出警报的此模板
var closable = alertify.alert().setting('closable');
alertify.alert()
.setting({
'label':'Agree',
'message': 'This dialog is : ' + (closable ? ' ' : ' not ') + 'closable.' ,
'onok': function(){ alertify.success('Great');}
}).show();发布于 2018-09-20 21:30:14
如果有人在2018年仍然有这个问题,我在ios上遇到过两次,我通过删除项目中的一个css包/库解决了这两种情况。
显然,bootstrap中的一些样式会影响Alertify的功能(在我自己的例子中)。
您可能希望签出项目中具有样式和CSS文件的所有其他库。
https://stackoverflow.com/questions/33552569
复制相似问题