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
Konrad Pilch
2,435 PointsTop stop jQuery
HI,
If yo look here
I want my sidebar, when touch the top of the browser, be fixed, and when near the footer, remove the class. Same vice-versa.
I'm not sure how this ment to look like.
Konrad Pilch
2,435 PointsI want to do it like here. But this is not the proper way to do it. Like facebook, once the sidebar hits the top, it stays fixed, and when it reaches almost the end to the footer, it goes up.
Kristopher Van Sant
Courses Plus Student 18,830 PointsOk, yeah that would be a sticky sidebar. I'm not sure what the facebook one looks like or how it behaves but if you do a google search for "sticky sidebar" I think you'll find what you're looking for. I'll post what I've find so far below.
1 Answer
Kristopher Van Sant
Courses Plus Student 18,830 PointsOk here's a few things I found. Hope they help!! :)
https://teamtreehouse.com/community/side-bar-that-scrolls-and-then-gets-fixed
https://css-tricks.com/scrollfollow-sidebar/
https://forum.jquery.com/topic/sticky-sidebar
https://blog.hartleybrody.com/creating-sticky-sidebar-widgets-that-scrolls-with-you/
Konrad Pilch
2,435 PointsSeem nice. I'm going to have a look at it when i wake up, right now my brain switched off xd
Thank you! :)
Kristopher Van Sant
Courses Plus Student 18,830 PointsKristopher Van Sant
Courses Plus Student 18,830 PointsI'm not 100% clear on what you're asking. Do you want your sidebar to be "sticky", meaning that it follows you when you scroll down?