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 The Plugin Challenge Solution

Vic Mercier
Vic Mercier
3,276 Points

I am a bit confusing about the property covered in the video (to fix the width of the sticked element)

getWithFrom:selector//What does that line do? Does it get the width from an element that doesn't bug when trying to increase the size of your window ?

1 Answer

Tadeáš Firich
Tadeáš Firich
7,866 Points

Hello Vic. It's just an object literal of this jQuery library. You can chceck the documentation for the library. I don't have any bugs and I use Chrome 60.

And i think it just get the actually with of the element.

this is my code:

$('.header').sticky({
  getWidthFrom: '.container',
  responsiveWidth: true,
});

$('.grid-full h5').sticky({
  topSpacing: 62,
  getWidthFrom: '.container',
  responsiveWidth: true,
});