设置为不透明度?

时间:2013-07-14 01:12:56

标签: toastr

有没有办法改变它?我尝试将toastClass定义为一个不透明度设置为1的类,但没有看到任何变化:

.toast-style{
   opacity: 1;
}

toastr.options.toastClass = 'toast-style';

5 个答案:

答案 0 :(得分:58)

这不需要JavaScript。您应该可以使用

在CSS中更改此设置
#toast-container > div {
    opacity:1;
}

.toast {
    opacity: 1 !important;
}

答案 1 :(得分:3)

答案 2 :(得分:1)

我需要为一个toastr做这个,所以走了这条路:

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;
}

答案 3 :(得分:0)

对于那些想要减少不透明度的人,他们可以这样做:

.toast-error { background-color: rgba(255,111,105,0.7) !important; }

答案 4 :(得分:0)

将“~ngx-toastr/toastr.css”中的所有 CSS 复制到应用程序的 style.css 文件中对我有用。