1

我有一些使用 Jquery Growl 函数的代码。但我想将其自定义为类似的东西 - https://codepen.io/killerek/pen/qqdZJp

我正在使用代码:

<script type="text/javascript">
    $.jGrowl('{$message}');
</script>

我想通过如下编辑这一行来使用我自己的css代码,但对我不起作用。

<script type="text/javascript">
    $.jGrowl('{$message}','{theme: 'default'});
</script>

还有其他想法吗?谢谢

4

1 回答 1

0

使用该theme选项的关键是 CSS 定义,因为theme它只是映射到一个 CSS 类。

jGrowl 存储库中,有一个示例文件夹可以演示此行为:

在此处查看 CSS: https ://github.com/stanlemon/jGrowl/blob/master/examples/jgrowl.html#L16-L19

.jGrowl .manilla {
    background-color:       #FFF1C2;
    color:                  navy;
}

这里的javascript: https ://github.com/stanlemon/jGrowl/blob/master/examples/jgrowl.html#L95-L120

$.jGrowl("Here is a custom theme.", {
    theme:  'manilla'
});

地图通知theme。_manilla.jGrowl .manilla

对于您的情况,您需要一个类似的声明.jGrowl .default

于 2019-09-01T18:35:47.700 回答