Setting toastr opacity?

試著忘記壹切 提交于 2019-12-03 06:30:39

问题


Is there any way to change it? I tried defining the toastClass as a class with opacity set to 1, but saw no changes:

.toast-style{
   opacity: 1;
}

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

回答1:


No JavaScript required for this. You should be able to change this in CSS using either

#toast-container > div {
    opacity:1;
}

or

.toast {
    opacity: 1 !important;
}



回答2:


#toast-container > div {
   opacity: 1;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
  filter: alpha(opacity=100);
}

Test Working Example;




回答3:


I needed to do this for a single toastr so went this route:

toastr.options = {
    ... 
};

toastr.info(
    'All of my favorite singers have stolen all of my best lines',
    'The Title'
);

$('#toast-container').addClass('nopacity');

...and then...

#toast-container.nopacity > div {
    opacity: 1;
}


来源:https://stackoverflow.com/questions/17635655/setting-toastr-opacity

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!