Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!