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

141
Views
I want the logo to appear animatedly when the navbar becomes sticky

https://weartuality.com/

You see the black navbar on that site. There is no logo on that black navbar, but when it becomes sticky, the logo appears. How can I do this using html css javascript?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Listen for the scroll event and show/hide the logo if a certain Y scroll position is reached.

const logoElement = document.querySelector(".logo"); // <--- update this selector
const checkLogo = () => {
   if (window.scrollY > 100) {// <-- your non-sticky nav's height here
       logoElement.style.setProperty("transform", "scale(1)");
   } else {
       logoElement.style.setProperty("transform", "scale(0)");
   }
}
checkLogo();
window.addEventListener("scroll", checkLogo);

CSS:

.my-logo {
    transform: scale(0);
    transition: transform .3s;
}
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!