Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Zurb foundation topbar dropdowns not working

I am working on a project that uses zurb foundations. I'm using there dropdown lists to view links. The topbar is white as opposed to its default black. When I click on the dropdown element in my localhost the lists doesnt appear. Why is this?

<div class='navbar'>
<nav class="top-bar" data-topbar>
    <section class="top-bar-section text-center">
        <ul class="">
            <li class="small-1"><%= link_to(root_path) do %>Home<% end %></li>
            <li class="small-1 has-dropdown"><a href="#">Profile</a>
                <ul class="dropdown">
          <li><a href="#">View All</a></li>
          <li><a href="#">Your Profile</a></li>
          <li><a href="#">Edit Profile</a></li>
        </ul>
            </li>
            <li class="small-1"><a href="#">Projects</a></li>
            <li class="small-1"><a href="#">Stories</a></li>
            <li class="small-1"><a href="#">Forums</a></li>
            <li class="small-1"><a href="#">Events</a></li>
            <li class="small-4 has-form">
              <div class="row collapse">
                <div class="small-8 columns">
                  <input class="radius" type="text" placeholder="&#x2315 Find Stuff">
                </div>
                <div class="small-4 columns">
                <a href="#" class="secondary button radius expand">Search</a>
                </div>
              </div>
            </li>
            <li class="small-1"><a href="#" class="menu-icon">&#9776</a></li>
            <li class="small-1 has-dropdown"><a href="#">&#9881</a>
                <ul class="dropdown">
                    <li><a href="#">Change Password</a></li>
                    <li><a href="#">Account</a></li>
                </ul>
            </li>
        </ul>
    </section>
</nav>
</div>

2 Answers

Chris Shaw
Chris Shaw
26,662 Points

Hi Tyler,

The top bar component is requires the foundation JavaScript in order to work, on the bottom of the top bar page they have an example of how to implement this JavaScript quickly by using the supplied scripts in the download.

Hope that helps.

Yes the foundation java script files are required in my java script manifest file and are rendered at the bottom of all my Web pages. Unless do I have to hand code some java script parameters to make this work?