【发布时间】:2013-07-12 05:17:28
【问题描述】:
有什么办法可以改变吗?我尝试将 toastClass 定义为不透明度设置为 1 的类,但没有看到任何变化:
.toast-style{
opacity: 1;
}
toastr.options.toastClass = 'toast-style';
【问题讨论】:
标签: toastr
有什么办法可以改变吗?我尝试将 toastClass 定义为不透明度设置为 1 的类,但没有看到任何变化:
.toast-style{
opacity: 1;
}
toastr.options.toastClass = 'toast-style';
【问题讨论】:
标签: toastr
此操作不需要 JavaScript。您应该可以使用
在 CSS 中更改它#toast-container > div {
opacity:1;
}
或
.toast {
opacity: 1 !important;
}
【讨论】:
toastr 的大多数用法都是半透明的——但如果用户做了那件特别的事情,我们希望大声而自豪地展示它(不透明),然后等待他们关闭它。
!important 几乎总是邪恶的
#toast-container > div {
opacity: 1;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
filter: alpha(opacity=100);
}
【讨论】:
我需要为一个烤面包机做这个,所以走这条路:
toastr.options = {
...
};
toastr.info(
'All of my favorite singers have stolen all of my best lines',
'The Title'
);
$('#toast-container').addClass('nopacity');
...然后...
#toast-container.nopacity > div {
opacity: 1;
}
【讨论】:
对于那些想要降低不透明度的人,他们可以这样做:
.toast-error { background-color: rgba(255,111,105,0.7) !important; }
【讨论】:
将“~ngx-toastr/toastr.css”中的所有 CSS 复制到应用程序的 styles.css 文件中对我有用。
【讨论】: