GoConqr has a new look! Let us know what you think.

Module 15 of 21 · Media

Create a dropdown navigation menu

Kostas Diakogiannis

Create a dropdown navigation menu

DOM-6 Create a dropdown menu content

Create a navbar that contains 5 list items (in my case movies' titles). Every movie title, when clicked, should reveal a list of the three main actors, and links that navigate the user to the official imdb page of this actor.

If clicked to another movie title, the previous one closes, and the new one, opens.

Every link when clicked must appear a different dropdown menu.

hint: You may want to create a class like 'shown' to make the dropdown list visible. When the link is clicked you may want to toggle this class to the menu that belongs to the link that was clicked (ev.target maybe helps in this case to identify which element is clicked?). You may find also useful if you can select children of elements through JS.

Bonus: When clicked everywhere else, all the open dropdown lists should be hidden again.

If you get stuck on this, you may want to see what event.stopPropagation() can do.  

See full result here

 

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?