gpt4 book ai didi

javascript - toastrjs - 悬停后更新计时器

转载 作者:行者123 更新时间:2023-12-04 15:49:45 25 4
gpt4 key购买 nike

我在 toastrjs 中找不到任何更新计时器的正确方法悬停后。
我确定了 extendedTimeOut为 0,不关闭 toastr当我将鼠标悬停在它上面时。toastr的超时时间|是 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"
});

最佳答案

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

$(function() {
toastr.info("Title", 'Subtitle', {
timeOut: 10000,
extendedTimeOut: 10000,
progressBar: true
});
});
<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" />

关于javascript - toastrjs - 悬停后更新计时器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59151948/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com