Toastr JS无限期地保持着可见的味道

noc*_*ist 5 javascript toastr

我正在尝试使用John Papa的Toastr插件显示一个Toast消息.(http://codeseven.github.io/toastr/demo.html)我无法在没有手动将"timeOut"和"extendedTimeOut"值手动设置为荒谬的高度的情况下找到一个选项,让toasts无限期地保持在屏幕上.有谁知道这样做的方法?

toastr.options = {
                "closeButton": true,
                "timeOut": "500000",
                "extendedTimeOut": "100000"
            }
            toastr.error('Error!');
Run Code Online (Sandbox Code Playgroud)

FrE*_*mAn 10

根据代码,将它们设置为0

timeOut: 5000, // Set timeOut and extendedTimeout to 0 to make it sticky
Run Code Online (Sandbox Code Playgroud)

  • 另外我还必须设置“extendedTimeOut”:0。 (2认同)