Submitted about 3 years ago
Sunny Landing Page Fully Responsive using ReactJS and Tailwind
@Rzkykhrllh
Design comparison
SolutionDesign
Solution retrospective
How to change color of navbar text when we scroll ? i don't have any idea how to implement this.
Community feedback
- Account deleted
Hi,
You should attach an event listener to the window and tell it do something on scroll, for instance;
window.addEventListener('scroll', () => { if (window.scrollY > px) { // do something } else { // do something } });
- scrollY means a vertical scroll.
- px should be a value.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord