Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

145
Vistas
How do I slideUp with animate as a function so that code waits until both events are done

I understand that in order for an even to happen 'after' a slideUp the following callback code can be used:

$('#something').slideUp('fast', function() {
   ... stuff to do after the slide is complete...
});

I want to achieve a slideUp with an animation to perform in the same way.

$('#something').slideUp().animate({opacity: 0,duration: 'fast'});

How do I transpose this code into a function that waits until both the slideup and the animation are complete before performing further code?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Something like this??

function animateAndExecute(functionToExecute) {
    $('#something').slideUp().animate({opacity: 0,duration: 'fast'});
    setTimeout(functionToExecute, 400) // Time taken to slide up. Use 600 if u use `slow` for animation duration.
}

and use it like

animateAndExecute(function() {
    // Code to execute after sliding and animating
})
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda