最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JGrowl set theme - Stack Overflow

programmeradmin7浏览0评论

My Jgrowl code is:

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

And my CSS in the Jgrowl CSS is:

.test{
    background-color:       #000000;
}

But it's not applying that CSS to the box. I'm probably misusing the theme option, but am struggling to find much documentation on it.

My Jgrowl code is:

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

And my CSS in the Jgrowl CSS is:

.test{
    background-color:       #000000;
}

But it's not applying that CSS to the box. I'm probably misusing the theme option, but am struggling to find much documentation on it.

Share Improve this question asked Jan 31, 2011 at 10:20 Tom GullenTom Gullen 61.8k88 gold badges291 silver badges469 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 18

The .test background-color is overridden by the "div.jGrowl div.jGrowl-notification" style. You could make the .test style !important:

.test{
    background-color:       #000000 !important;
}

or access the .test class more specifically like so:

"div.jGrowl div.jGrowl-notification.ui-state-test"

this will override it too

You can use the parameter of Configuration Options of jGrowl

theme is a CSS class designating custom styling for this particular message, intended for use with jQuery UI.

CSS:

.jGrowl .changeCount {
    background-color: #337ab7;
}

JS:

$.jGrowl("Message in box", {theme: 'changeCount'});

More information about this plugin here: https://github./stanlemon/jGrowl/blob/master/README.md

发布评论

评论列表(0)

  1. 暂无评论