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

Konrad Pilch
Konrad Pilch
2,435 Points

How to add animation?

Hello,

I know how to add animatino with jQuery, its just that i have no idea how to add animation like transition.

I know i can hide it and then fadeOut, but what about transition?

Heres my code

Im basically trying to reduplicate this site header(if you scroll down and up and look at the nav): http://www.bradhussey.ca/

2 Answers

Shane Oliver
Shane Oliver
19,977 Points

The link to your code doesn't work, but you will need to add a z-index to the nav to place it on top of all other elements. Try logging to the console to determine the problem.

Konrad Pilch
Konrad Pilch
2,435 Points

It shoudl work now. I don't know how the console logs work with codepen : p

Shane Oliver
Shane Oliver
19,977 Points

you are adding the class incorrectly and in the wrong place.

add this line to your conditional checking the scroll position var navbar = $('nav').addClass('fixed');