toastrjs - 悬停后更新计时器

Tim*_*rin 6 javascript toastr

toastrjs悬停后我找不到任何正确的方法来更新计时器。我确定 aextendedTimeOut到 0,toastr当我将鼠标悬停在它上面时不关闭它。timeOut oftoastr是 10000 毫秒,但是当我完成悬停时,toastr立即隐藏起来。toastr在我完成悬停后显示10000 毫秒的正确方法是什么。

我的 toastr 属性示例:

const inboxToastr = toastr;
inboxToastr.info(data.bubbleData, title, {
    "tapToDismiss": false,
    "closeButton": true,
    "newestOnTop": false,
    "progressBar": false,
    "positionClass": "toast-bottom-left", //position
    "preventDuplicates": false,
    "onclick": null,
    "showDuration": "300",
    "hideDuration": "1000",
    "timeOut": "10000",
    "extendedTimeOut": "0",
    "hideEasing": "linear",
    "iconClass": "background-gray"
});
Run Code Online (Sandbox Code Playgroud)

Van*_*jx1 1

使用 timeout 10000 和 ExtendedTimeOut 10000 以及其他默认选项似乎可以按您的预期工作,10 秒后自动关闭,悬停时保持显示,悬停后隐藏 10 秒。

$(function() {
  toastr.info("Title", 'Subtitle', {
    timeOut: 10000,
    extendedTimeOut: 10000,
    progressBar: true
  });
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet" />
Run Code Online (Sandbox Code Playgroud)