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

255
Visualizações
Show/hide multiple images in sequence with JS

I have working code for a) clicking a button, b) displaying an image for n ms, c) then hide it:

<html>
<body>
<h1>Test</h1>
<p><b>Display Image </b></p>
<p>Click on button to display the image.</p>
<!-- button -->
<button id="btnId1">100 ms</button>
<!-- image to hide and show -->
<img src="img/img-a.jpg" alt="" id="imageID1" width="300" height="300" style="display: none" />

<script>

// add click event to button
    document.getElementById("btnId1").addEventListener('click', function() {
        //show image
        document.getElementById('imageID1').style.display='block';
        // hide image after 100 ms.
        setTimeout(function() {
          document.getElementById('imageID1').style.display='none';
        }, 100);
    });

</body>
</html>

What I would like to do is

a) Click the button, b) display + hide several .jpg images in sequence, and c) have the control for each image on how long to display it

I have looked through similar topics/posts but haven't found what I'm looking for.

Thanks in advance for any input, -- JW

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