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

205
Visualizações
How can I fade out one img then fade in another?

So I am using jQuery to fade in and out but I encountered the problem in which when I run the code the img is faded out but the same img fades back in. I am stuck.

Here is the code

$(document).ready(function() {

    // preload the image for each link
$("#image_list a").each(function() {
    var swappedImage = new Image();
    swappedImage.src = $(this).attr("href");
});
//-------------------------




    // set up the event handlers for each link
$("#image_list a").click(function(evt) {
   // alert($(this).attr("title"))

    $("#image, #caption").fadeOut(3000, function(){
        $("#image").attr("src", $(this).attr("href"));
        $("#caption").text($(this).attr("title"));
    });




    $("#image, #caption").fadeIn(3000);

    evt.preventDefault();
});

            // get the image URL and caption for each image and animate the caption

        // cancel the default action of each link


// move the focus to the first link

}); // end ready

about 4 years ago · Juan Pablo Isaza
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