TechCrunch recently redesigned their site and they have a sweet header that minifies into a thinner version of their branding as you scroll down.
You can see what I mean here: http://techcrunch.com/
How would I go about creating something like this? Is there a tutorial anywhere and if not, can one you kind souls give me some tips on where to start? 🙂
It’s not too hard, it’s just a simple
.scroll()event.I can’t seem to do it in fiddle because of the way the panels are positionedCheck EDIT!. But basically what you have is have adivon the top that isposition: absoluteso it’s always on top, then use.scroll()The
scrollTop()method is used to determine how much thebodyhas scrolled.And depending on where you would like to change your header div, you can have your
ifstatement do many things. In the case of the example you provided, it would be something likeEDIT
Yay! I was able to make this fiddle to demonstrate the example! 🙂
Good luck!