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
Andrew Stelmach
12,583 PointsMaking the page scroll up and down in the background
https://github.com/Yorkshireman/pinteresting
I want the page to animate, scrolling up and down in the background, behind the jumbotron.
As a minimum, I want to disable scrolling when the user isn't signed in. (overflow: hidden doesn't work, because you can still scroll with the mouse wheel).
Absolutely no idea how to achieve the first aim. Any ideas?
1 Answer
Jesse Fisher
10,830 PointsSet your jumbotron to a fixed position.
If you set the body to overflow: hidden scrolling should be disabled. However if the view port is not tall enough, the user won't be able to see the Sign Up / Login buttons.
Maybe add some buttons up top for small screens
.jumbotron {
position: fixed;
}
body {
overflow: hidden;
}
Andrew Stelmach
12,583 PointsAndrew Stelmach
12,583 PointsAh my bad - I'd gotten it into my head that default positioning was 'fixed', so I assumed it wouldn't work. But now I realise that default positioning is 'static'. 'Fixed' works. Nice one.