0
代碼返回true或false:如何當我代碼window.confirm自己
(function (proxied) {
window.confirm = function (msg) {
noty({
text: '<i class="fa fa-exclamation-triangle">'+msg+'</i>',
theme: 'relax',
dismissQueue: true,
layout: 'center',
buttons: [
{
addClass: 'btn btn-success btn-circle', text: '<i class="fa fa-check"></i>', onClick: function ($noty) {
$noty.close();
return true;
}
},
{
addClass: 'btn btn-danger btn-circle', text: '<i class="fa fa-times"></i>', onClick: function ($noty) {
$noty.close();
return false;
}
}
]
});
//return proxied.apply(this, arguments);
};
})(window.confirm);
它不能正確的返回真或假,我想這可能是按鈕關閉謝謝大家。
什麼是'noty({})'?是一個定義的函數嗎? – evolutionxbox
你確定函數被調用嗎? –
noty - jQuery Notification Plugin –