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

161
Visualizações
I want to make an icon disapere after some time and I want another icon to take its position after one second delay. I am using font awesome

Ok how can I make a font disapere after some time and another icon to take its place with one second delay and this thing should be going on in a loop and I am using font awesome so please help.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

you can do something like this

const switchIcon = (container,newHtml, timeout) => {
  
  setTimeout(() => {
    container.innerHTML = ''
    setTimeout(() => {
      container.innerHTML = newHtml
    }, 1000)
  }, timeout)
  
}


switchIcon(document.getElementById('icon-container'), '<span> icon 2</span>', 3000)
<div id="icon-container">
<span>icon 1</span>
</div>

about 4 years ago · Juan Pablo Isaza Relatório

0

On top of your css insert

    @keyframes icon1 {
      0%   {opacity: 1; z-index: 1000;} 
   /* Change opacity as you like 1= visible 0=not visible, you can also add other % like 20% 10% to make it happen faster and add any css property*/
      50%  {opacity: 0.5;}
      100% {opacity: 0; z-index: -1;}
    }
    @keyframes icon2 {
      0%   {opacity: 0; z-index: -1;} /* Change opacity as you like 1= visible 0=not visible */
      50%  {opacity: 0.5;}
      100% {opacity: 1; z-index: 1000;}
    }
    /*If you need it clickable just add z-index or insead of z-index add visibility: hidden when opacity is 0 and visibility: visible to opacity 1*/
    
    then add this to your first icon's css
    animation-name: icon1;
    animation-duration: 4s; //change seconds
    animation-iteration-count: infinite;

    
    and this to your second icon's css
    animation-name: icon2;
    animation-duration: 4s; /* Change seconds */
    animation-iteration-count: infinite;

I didn't make it work as you would but you can just change value between them. you can use absolute position to make them stand on top of each other, remember that position absolute needs top or bottom: (any px you want) px; and left or right: (any px you want) px;. Also set parent to relative.

You can also add transition property to make it smooth, always on icon's css example

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