【问题标题】:Toastr doesn't fire when using options使用选项时,Toastr 不会触发
【发布时间】:2013-05-03 05:31:02
【问题描述】:

我正在尝试使用toastr js library

我包括了 toastr.js、toastr.css 和 toastr-responsive.css 这有效:

toastr.info("Hello world");

但这不起作用。而且我在浏览器控制台中没有收到任何错误:

toastr.options.positionClass = "toast-top-full-width";
toastr.info("Hello world");

会是什么原因?

【问题讨论】:

    标签: javascript user-interface notifications toastr


    【解决方案1】:

    创建一个小提琴,告诉我你在做什么。

    更新:

    您不应链接到 github 中的原始 css 和 javascript。这些不是 CDN,因此它们不是为提供代码而设置的。您应该为您的项目提取代码或在 Visual Studio 中使用 NuGet。

    例如,如果您将 CSS 复制到 JsFiddle CSS 窗口中,如下所示: http://jsfiddle.net/7Ucj9/10/

    为了完整起见,这里是我所做的小代码更改......但这与它无关

    $(function () {
    
        toastr.info("Are you the 6 fingered man?");
    
        $("#foo1").click(function () {
            alert("test");
        });
    
        $("#foo2").click(function () {
            toastr.info("Are you the 6 fingered man?");
            console.log("hello");
        });
    });
    

    【讨论】:

    猜你喜欢
    • 2023-03-15
    • 1970-01-01
    • 2013-12-23
    • 1970-01-01
    • 2019-03-02
    • 1970-01-01
    • 2016-10-20
    • 2020-04-27
    • 1970-01-01
    相关资源
    最近更新 更多