我一直在玩toastr,并成功地将超时设置为0,这样吐司仍然是粘性的,但是当我用鼠标移出吐司时,吐司就消失了。我想要覆盖它,这样当用户点击它时,toast才会消失--非常适合有很多文本的toast。如何做到这一点?
发布于 2013-07-02 08:17:38
也将extendedTimeOut
设置为0。这将使它保持粘性。
发布于 2017-03-23 00:00:54
timeOut
和extendedTimeOut
必须设置为0
。
下面是一个完整的示例:
toastr.options = {
timeOut: 0,
extendedTimeOut: 0
};
toastr.info("Testing <button>blah</button>");
对于那些不希望在单击时关闭toast的用户,该示例更改为:
toastr.options = {
timeOut: 0,
extendedTimeOut: 0,
tapToDismiss: false
};
toastr.info("Testing <button>blah</button>");
发布于 2019-09-25 08:01:09
您还可以使用disableTimeOut
作为将timeOut
和extendedTimeOut
设置为0的替代方法。
toastr.options = {
disableTimeOut : true, //Equivalent ot timeOut: 0 and extendedTimeOut: 0
}
https://stackoverflow.com/questions/17411171
复制相似问题