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 jQuery Basics (2014) Creating a Mobile Drop Down Menu Plan

Not sure how the tabbed menu works

Before we even get into the jQuery part of this, I'm not sure how the existing tabbed menu works.

The class "selected" seems to move to a different list element when you click on the corresponding tab. But how does the class move? I've looked through the CSS, and I don't see what's triggering that.

If anyone can explain, I would be grateful.

Hey jenp actually when you click on about tab the about.html page display where <li> with about name have class selected

Thanks rick harrison... I thought it was somehow changing dynamically, but it is not.

2 Answers

Zak Posner
Zak Posner
8,473 Points

Each tab within the project represents a different page of the website. The selected tag is used to identify which page in the navigation the user is currently visiting,. So on the back end, we use the selected tag on each page - attaching it to the link in the navigation which matches the current page.

When you are on the About page, the site loads the html code from about.html, which happens to have the selected tag placed in the about link of the unordered list of that page.

Karolin Rafalski
Karolin Rafalski
11,368 Points

I think what you are seeing is some functionality in html.

HTML has a select tag that then has options inside:

http://www.w3schools.com/tags/tag_option.asp