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.

JavaScript

Dropdown menus using jquery

I have a question about using jQuery to make a dropdown menu. What I would like to do is make it so that jQuery will display a div when a user hovers over the li which I have gotten to work. The part that I don't understand is this... I would like to make it so that when the user's mouse leaves the dropdown div it will animate the opacity back down to 0, but for some reason the jQuery doesn't recognize it because it has a position of absolute. Is there anyway to fix this issue?

1 Answer

Don't quite understand your answer. Have you tried using display none on your div and using fadeIn and fadeOut functions in JQuery .

I am basically saying that when I change the CSS to a position property of "relative" then the jQuery will recognize a "mouseleave" but when the position property is in absolute it will not recognize the "mouseleave"

I hope I made it a bit more clear

Can you provide a snippet on http://codepen.io/ that will be helpful and we can work on it together.