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

311
Views
¿La función de devolución de llamada de animate (completa) se ejecutó al inicio?

Estoy usando jQuery 1.5.1 Este es mi código:

 $('.cellcontent').animate({ left: '-=190'}, { easing: alert('start ani'), duration: 5000, complete: alert('end ani')});

¿Recibo ambas alertas antes de que comience la animación? Quiero que la función completa comience después de que finalice la animación. ¿Alguna idea?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Necesitas pasar una función para llamar. En su lugar, está llamando a la función.

 complete: function() { alert('end ani'); }
over 4 years ago · Santiago Trujillo Report

0

Veo dos cosas mal con esto.

Uno, la easing debería ser:

Una cadena que indica qué función de aceleración usar para la transición

Y complete debe ser una función.

http://api.jquery.com/animate

 alert('start ani'); $('.cellcontent').animate({ left: '-=190' }, { easing: 'swing', duration: 5000, complete: function(){ alert('end ani'); } });
over 4 years ago · Santiago Trujillo Report

0

Necesita pasar una función para completar.

Prueba esto:

 $('.cellcontent').animate({ left: '-=190'}, { easing: alert('start ani'), duration: 5000, complete: function() { alert('end ani') } });

Dado que complete espera una función, ejecuta el código que le pasa para obtener un objeto de función al que puede volver a llamar cuando termine.

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!