Javascript 更改PNotify中的背景色
我正在使用一个主题,Porto-Admin主题 此主题使用PNotify传递通知: 当您在上面列出的Pnotify链接上选择“bootstrap4”(或bootstrap3)而不是深色难看的颜色时,我想在这个浅粉色方案中进行通知。我该怎么做Javascript 更改PNotify中的背景色,javascript,bootstrap-4,pnotify,Javascript,Bootstrap 4,Pnotify,我正在使用一个主题,Porto-Admin主题 此主题使用PNotify传递通知: 当您在上面列出的Pnotify链接上选择“bootstrap4”(或bootstrap3)而不是深色难看的颜色时,我想在这个浅粉色方案中进行通知。我该怎么做 function notify (message, type){ new PNotify({ title: false, text: message, type: type, a
function notify (message, type){
new PNotify({
title: false,
text: message,
type: type,
addclass: 'ui-pnotify-no-icon',
icon: false,
buttons: {
sticker: false
}
});
}
这是我的密码
function notify(message, type, class){
new PNotify({
title: false,
text: message,
type: type,
addclass: class,
icon: false,
buttons: {
sticker: false
}
});
}
然后调用notify('yourmessage'、'custom'、'yourcss class')代码>CSS:
/* Alert Success Color */
.custom-notification-alert-success .notification {
color: #155724;
background-color: #d4edda;
border-color: #c3e6cb;
}
.custom-notification-alert-success .ui-pnotify .notification .ui-pnotify-icon > span {
border-color: #c3e6cb;
}
/* Alert Danger Color */
.custom-notification-alert-danger .notification {
color: #721c24;
background-color: #f8d7da;
border-color: #f5c6cb;
}
.custom-notification-alert-danger .ui-pnotify .notification .ui-pnotify-icon > span {
border-color: #f5c6cb;
}
/* Alert Warning Color */
.custom-notification-alert-warning .notification {
color: #856404;
background-color: #fff3cd;
border-color: #ffeeba;
}
.custom-notification-alert-warning .ui-pnotify .notification .ui-pnotify-icon > span {
border-color: #ffeeba;
}
/* Alert Info Color */
.custom-notification-alert-info .notification {
color: #0c5460;
background-color: #d1ecf1;
border-color: #bee5eb;
}
.custom-notification-alert-info .ui-pnotify .notification .ui-pnotify-icon > span {
border-color: #bee5eb;
}
/* Alert light Color */
.custom-notification-alert-light .notification {
color: #818182;
background-color: #fefefe;
border-color: #fdfdfe;
}
.custom-notification-alert-light .ui-pnotify .notification .ui-pnotify-icon > span {
border-color: #fdfdfe;
}
/* Alert dark Color */
.custom-notification-alert-dark .notification {
color: #1b1e21;
background-color: #d6d8d9;
border-color: #c6c8ca;
}
.custom-notification-alert-dark .ui-pnotify .notification .ui-pnotify-icon > span {
border-color: #c6c8ca;
}
JavaScript:
function notify (message, type){
new PNotify({
title: false,
text: message,
type: type,
addclass: 'custom-notification-alert-success ui-pnotify-no-icon',
icon: false,
buttons: {
sticker: false
}
});
}
欢迎来到SO。你的问题针对这个主题,因此很难得到答案。样式可以在CSS中找到,显然是在ui pnotify no icon类上。我不希望它是自定义类,我希望它使用引导中列出的默认警报类。喜欢他们网站上的演示。看看上面的示例和上面的脚本