Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
02-10-2015, 07:40 PM | #1 |
Confirmed User
Industry Role:
Join Date: Jan 2015
Location: usa
Posts: 468
|
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? |
02-10-2015, 09:16 PM | #2 |
Confirmed User
Industry Role:
Join Date: Nov 2014
Location: Montreal
Posts: 101
|
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 |