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

Changing fixed position button on background change.

I was looking at this page and was intrigued by a cool effect it had.

http://www.brianhoffdesign.com/

When the user scrolls down the page, and the menu icon in the top right, which is fixed in position, is sitting above the navy blue background, the colour of the menu icon changes from black to white. Then when the user scrolls past the blue background, the menu icon changes colour back to black.

Does anyone have an idea how this might be done?

I'm assuming it's done with some JavaScript/jQuery

THanks to anyone who might have a suggestion :)

johnathanmyers
johnathanmyers
20,144 Points

Hey Gabriel, If you right click on the web page in the browser and choose View page source you should be able to view the code for the web page and see what is going on behind the scenes so you can figure out how they did it.