Search code examples
javascripttoastr

Toastr JS keep toasts visible indefinitely


I'm attempting to show a toast message using the Toastr plugin from John Papa. (http://codeseven.github.io/toastr/demo.html) I'm having trouble finding an option to have the toasts remain on screen indefinitely without manually setting the "timeOut" and "extendedTimeOut" values to something absurdly high. Does anyone know of a way to do this?

toastr.options = {
    "closeButton": true,
    "timeOut": "500000",
    "extendedTimeOut": "100000"
}
toastr.error('Error!');

Solution

  • Based on the code, set them to 0

    timeOut: 5000, // Set timeOut and extendedTimeout to 0 to make it sticky