Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Drew Templeton
6,509 PointsParallax Scroll
I am looking to do something similar to what's on the http://apiary.io/ homepage. Notice how the top section resizes to 100% of the screen height and that the headline text is vertically centered within the dynamic height of the section.
Does anyone have any advice on how I'd do this?
1 Answer
Chris Akers
2,527 PointsHmm. Maybe they've changed it since you posted but I don't see it being 100% of the height nor any parallax. The behavior I see is that the header is position:fixed to the top and starts at 150px tall when the page is scrolled all the way up. When the page is scrolled down then the padding of the header is reduced so that it's 95px tall. It also uses some CSS transistions so that the changes in height are smooth.
I'm not aware of any libraries that provide this exact behavior but with a little bit of work it should be possible to dissect their code and come up with a reasonable reproduction.
Adam Davies
65 PointsAdam Davies
65 PointsThat site is really nice. I had a wordpress theme which has a similar nav bar