Vous réglez l'opacité toastr?

Est-il possible de le changer? J'ai essayé de définir la classe toastClass comme une classe avec l'opacité fixée à 1, mais n'ai vu aucun changement:

.toast-style{
   opacity: 1;
}

toastr.options.toastClass = 'toast-style';
30
demandé sur RobVious 2013-07-14 05:12:56

3 réponses

pas de JavaScript requis pour cela. Vous devriez pouvoir modifier ceci dans CSS en utilisant l'un ou l'autre

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

ou

.toast {
    opacity: 1 !important;
}
50
répondu John Papa 2014-05-09 04:06:13
#toast-container > div {
   opacity: 1;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
  filter: alpha(opacity=100);
}

Test Exemple De Travail;

2
répondu Angelina 2018-01-12 06:17:17

j'avais besoin de faire ça pour un toastr simple donc j'ai pris cette route:

toastr.options = {
    ... 
};

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

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

...et puis...

#toast-container.nopacity > div {
    opacity: 1;
}
1
répondu Madbreaks 2016-09-23 00:01:53