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

amadeo brands
amadeo brands
15,375 Points

Java script question

I made this script ...

But it tells me that the function is not defined. Any idea any body?

/* Custom Javascript */

console.log('start');

$(window).on("scroll touchmove", function () {
    $('#header_nav').toggleClass('tiny', $(document).scrollTop() > 0);
    $('#logo').toggleClass('tiny', $(document).scrollTop() > 0);
    $('#navbar-nav01').toggleClass('tiny', $(document).scrollTop() > 0);
    $('#navbar-small-toggel').toggleClass('tiny', $(document).scrollTop() > 0);
});

console.log('end');

//Fixed Code Presentation How to post code

1 Answer

Erwin Meesters
Erwin Meesters
15,088 Points

Maybe jQuery is undefined? Does the error mention the $ sign?