Skip to content

Commit

Permalink
made the bg color transparent in else condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Shweta-1902 committed Oct 12, 2024
1 parent 7f6f6c7 commit 2125ae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,10 @@ <h4 id="custom-follow-heading">Follow Us</h4>
window.onscroll = function() {
var navbar = document.querySelector(".navbar");
if (window.scrollY > 50) {
navbar.style.backgroundColor = "none"; // Dark background on scroll
navbar.style.backgroundColor = "rgba(0, 0, 0, 0.8)"; // Dark background on scroll
navbar.querySelectorAll("a").forEach(a => a.style.color = "white"); // Change link color
} else {
navbar.style.backgroundColor = "none"; // Revert back to light background
navbar.style.backgroundColor = "transparent"; // Revert back to transparent background
navbar.querySelectorAll("a").forEach(a => a.style.color = "white"); // Revert link color
}
};
Expand Down

0 comments on commit 2125ae2

Please sign in to comment.