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

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

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 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