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

JavaScript Using jQuery Plugins Add a Sticky Navigation Bar Adding Sticky Navigation

Vic Mercier
Vic Mercier
3,276 Points

What does the topSpacing property do?

I don't understand.

1 Answer

Nate Jonah
Nate Jonah
20,981 Points

topSpacing lets you specify how many pixels between your sticky element (the navbar in this case) and the top of the page. So if it was {topSpacing: 10} then that would be like going into the CSS file and adding {margin-top: 10px}