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

Sergio Cruz
Sergio Cruz
15,550 Points

sticky() only applies to work.html. Does not work on team.html or index.html. Console says sticky is not a method

They are both linked the same way as work.html. No typos. They both have the header class. I dont understand why it doesnt work. This is how the js are linked:

    </footer><!--/footer-->
    </div>
    <script src="js/jquery-1.11.2.min.js"></script>
   <script src="js/animsition/jquery.animsition.min.js"></script>
   <script src="js/sticky/jquery.sticky.js"></script>
   <script src="js/main.js"></script>
</body>

</html>

And they all have:

<div class="row container animsition"> <header class="row header">

I'm calling them on the external js file with:

$('.header').sticky();

For some reason it only works in work.html. What's happening?

3 Answers

did you find an answer to this i am having the same problem

Sergio Cruz
Sergio Cruz
15,550 Points

No, nothing. All my script tags are in place so I don't know whats causing it

Sam Davidoff
Sam Davidoff
5,295 Points

Hey,

I had the same issue and resolved it by checking all the script tags, there was a typo that I copied onto the other pages. I think that when a function isn't recognized it always has to do with with asset sourcing.

Hope that helps