2
我嘗試添加按鈕到諾蒂確認,但它似乎不工作,任何想法爲什麼?確認諾蒂jQuery插件按鈕
我把代碼noty的網站下的子部分按鈕:
警報似乎沒有按鈕做工精細,它只是試圖添加按鈕時,什麼也不會顯示出來!
下面的代碼:
function Sure()
{
var n = noty({
text: 'Are you sure?',
type: 'confirm',
dismissQueue: false,
layout: 'center',
theme: 'defaultTheme'
buttons: [
{addClass: 'btn btn-primary', text: 'Ok', onClick: function($noty) {
// this = button element
// $noty = $noty element
$noty.close();
noty({text: 'You clicked "Ok" button', type: 'success'});
}
},
{addClass: 'btn btn-danger', text: 'Cancel', onClick: function($noty) {
$noty.close();
noty({text: 'You clicked "Cancel" button', type: 'error'});
}
}
]
})
}
有一個逗號缺少'主題:'defaultTheme',' 正確,並再試一次 – UnLoCo
修復它..謝謝! – WToa