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

149
Views
how to show the intro image only once

I have svg and img introduction before proceed to the main page. how I show this introduction only once? here is my code:

<div class="preload">
   <div class="intro">        
      <img src="svg/toreriha_text_animated.svg">
      <img class="bground" src="/img/background.png">
   </div>
</div>


<script type="text/javascript">
   setTimeout(function() {
   //After 9000 milliseconds, fade out the intro. The animation duration is 500 ms.
   $(".intro").fadeOut(500);
   }, 9000);
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you are willing to show the intro only when the user visits the page for the first time, here is a workaround: add a hide class to the intro. When the page loads, check for a value (introLoaded in this case) in localStorage. If it is not set, remove the hide class, show the intro and set the value.

if (!localStorage.getItem("introLoaded")) {
  $(".intro").removeClass("hide");
  localStorage.setItem("introLoaded", "true");
  setTimeout(function() {
    $(".intro").fadeOut(500);
  }, 9000);
}
.intro.hide {
  display: none;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="preload">
  <div class="intro hide">
    <img src="svg/toreriha_text_animated.svg">
    <img class="bground" src="/img/background.png">
  </div>
</div>

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!