Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

317
Views
Close toastr.error after a few seconds in Javascript

I'm using toastr.error('Testing pop-up') in Javascript to show me a pop-up when there is an error in the application, but I can't see in the official documentation how to close this pop-up after X seconds automatically without pressing any button. Does anyone know how?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can set timeout like:

Timeouts
Control how toastr interacts with users by setting timeouts appropriately.

toastr.options.timeOut = 30; // How long the toast will display without user interaction
toastr.options.extendedTimeOut = 60; // How long the toast will display after a user hovers over it

Reference:

  • Official DOC
  • Playable example
about 4 years ago · Juan Pablo Isaza Report

0

The signature for the error function is:

            function error(message, title, optionsOverride) {

https://github.com/CodeSeven/toastr/blob/50092cc604850a16c985520b63df184d3e0b4086/toastr.js#L46

You can pass options to hide it as needed.

You can play with the options to see the best fit in the demo page:

https://codeseven.github.io/toastr/demo.html

enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!