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

Drop Down Menu with smooth scrolling

Hi everyone,

I'm a newbie and my english is not good, so I apologize in advance. I am trying to create a drop down menu that changes to a normal navigation bar in bigger widths, following a mobile first strategy, the opposite to the "Creating a Mobile Drop Down Menu" exercise on the JQuery Basics Course, and with the anchors in the same page. I also would like a smooth scrolling when you switch from one option to another, and I would also like to stick the dropdown menu to the top after scrolling down a little.

To get the idea of what I want please check the nav bar below the picture of the phone in the following link:

http://smartphones.findthebest.com/l/659/Samsung-Galaxy-S5

This is the code I have so far:

http://codepen.io/anon/pen/wEauI

Everything works except the smooth scrolling, but far away from how it works in the findthebest website. The nav sometimes disappears when you click.

Hope someone can help me. Thank you very much.