三國紛爭
2022-01-20 18:38:13
toastrjs懸停后我找不到任何正確的方法來更新計時器。我將 a 確定extendedTimeOut為 0,toastr當我將鼠標懸停在它上面時不關閉它。timeOut 的時間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"});
1 回答

慕哥6287543
TA貢獻1831條經驗 獲得超10個贊
使用 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" />
添加回答
舉報
0/150
提交
取消