CodeSeven / toastr

Simple javascript toast notifications
http://www.toastrjs.com
MIT License
11.96k stars 2.04k forks source link

How to add a countdown timer as content #613

Open badbyt3 opened 5 years ago

badbyt3 commented 5 years ago

I'm trying to add a count down of 5 minutes to the toastr. Now, I'm able to add the 300 seconds. The current solution that I was able to reach is that I generate a bunch of toastr intances lined up under each other. But how to I create only one toastr that shows my count down?

This is the configuration of my toatr: toastr.options = { "closeButton": false, "debug": false, "newestOnTop": true, "progressBar": false, "positionClass": "toast-top-right", "preventDuplicates": true, "onclick": null, "showDuration": "1", "hideDuration": "0", "timeOut": "1", "extendedTimeOut": "0", "timeOut": "0", "showEasing": "swing", "hideEasing": "linear", "showMethod": "fadeIn", "hideMethod": "fadeOut", "opacity":"1" }

amuagarwal commented 3 years ago

Any luck to get this to show countdown with progress bar. something like "toast will close in {n} minutes and {n} seconds"

badbyt3 commented 3 years ago

Solved it in a different way.

yancelawang commented 1 year ago

Solved it in a different way.

Can you share how you solve it?