![]() |
Anyone know CSS? How can I do a navbar like this?
Hi I saw this navbar on CNN CNNMoney - Business, financial and personal finance news
And when you scroll down the logo shrinks. I really like this. Is there a tutorial on how to do this? |
1. Listen to the page scroll event with JavaScript
2. To know how many pixel the page scrolled down, you can look at this attribute document.documentElement.scrollTop 3. When it scrolled enough to your liking, then you can add a class to your header element with a CSS transform example: myHeader.classList.add('scaledown') Here with the steps and a demo |
All times are GMT -7. The time now is 07:13 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc