alexcican / lab

Various coding experiments and demos
https://lab.alexcican.com
MIT License
289 stars 110 forks source link

Nav bar hiding after a certain point #3

Closed rodrigoibarra closed 10 years ago

rodrigoibarra commented 10 years ago

Hi, I was wondering if there's a way to get the nav bar hiding after a certain amount of scroll instead of hiding it as soon as the user scrolls down. I cant really get my head around doing this.

Thanks for the awesome work btw

alexcican commented 10 years ago

On <nav> you need to add the class .detached by default and check with JS once it passes detachPoint = 650 to hide the menu by adding the class .invisible.