Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

322
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda