JGrowl设置主题

Tom*_*len 6 javascript css jquery jgrowl

我的Jgrowl代码是:

    $(document).ready(function() {
        $.jGrowl("<strong>Error!</strong><br />An invalid ID was passed and your template could not be loaded", { sticky: true, theme: 'test' });
    });
Run Code Online (Sandbox Code Playgroud)

我在Jgrowl CSS中的CSS是:

.test{
    background-color:       #000000;
}
Run Code Online (Sandbox Code Playgroud)

但它没有将CSS应用到盒子中.我可能会滥用主题选项,但我很难找到很多关于它的文档.

And*_*ndy 17

.test背景颜色被"div.jGrowl div.jGrowl-notification"样式覆盖.你可以制作.test风格!重要的是:

.test{
    background-color:       #000000 !important;
}
Run Code Online (Sandbox Code Playgroud)

或更具体地访问.test类:

"div.jGrowl div.jGrowl-notification.ui-state-test"
Run Code Online (Sandbox Code Playgroud)

这也会覆盖它