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

:hover on mobile devices

Hi everyone,

I've been making a menu on codepen, its not going to bad but im struggling with on or two things.

When the menu breaks to suit mobile devices, i would like it to be one bar "main menu" then if the user presses this it will open the nav as seen currently.

Also there are sub menus and it would be great if i could so the same for them to ....

I've listed this under JavaScripts as I was told this could be needed ... I have no knowledge of JavaScript at alll.... plus it would be cool to make this work using only css

All help is much appreciated !!

Thanks Craig

1 Answer

The problem is that :hover doesn't generally work on mobile devices so you need another type of action to show the menu. That being said there are a few options you have: