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

CSS Framework Basics Prototyping with Foundation Building a JavaScript Dropdown Menu and Orbit Slider

Modernzr vs dropdown menu in Foundation

Hello folks. Ive been playing around with Foundation and ended up having a trouble getting dropdown menu to funciton while there is a script of modernzr in the head section. After removing the script, dropdown works just fine but what if I need to use modernzr ? How can I fix this problem without having to remove the modernzr script? Thanks

2 Answers

I would check to see of any of the classes that modernizr is adding to the HTML element are affecting the dropdown CSS.

Something thing to keep in mind is that you can (and probably should) create your own custom build of modernizr that only tests for things that you want to test for. I'm not sure what Foundation is including in their modernizr file, but I've noticed most default builds test for everything, and that's usually not necessary. Each test that modernizr runs does take time to run (granted a very small amount), so it's best to only use what you need.

You could also check the console in Chrome DevTools, or whatever you use for browser debugging to see if there are javascript errors.

Gwenaรซl Magnenat
Gwenaรซl Magnenat
14,617 Points

By adding data-topbar to the navigation it made the dropdown work for me with foundation 5.2.1 Foundation 5 topbar documentation