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

304
Views
¿Cómo retraso una llamada de función durante 5 segundos?

Quiero que widget.Rotator.rotate() se retrase 5 segundos entre llamadas... ¿cómo hago esto en jQuery... parece que jQuery's delay() no funcionaría para esto...

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Puede usar javascript simple, esto llamará a your_func una vez, después de 5 segundos:

 setTimeout(function() { your_func(); }, 5000);

Si su función no tiene parámetros ni un receptor explícito, puede llamar directamente a setTimeout(func, 5000)

También hay un complemento que he usado una vez. Tiene métodos oneTime y everyTime .

  • Complemento de temporizadores jQuery
over 4 years ago · Santiago Trujillo Report

0

var rotator = function(){ widget.Rotator.rotate(); setTimeout(rotator,5000); }; rotator();

O:

 setInterval( function(){ widget.Rotator.rotate() }, 5000 );

O:

 setInterval( widget.Rotator.rotate.bind(widget.Rotator), 5000 );
over 4 years ago · Santiago Trujillo 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!