treehouse : what would you like to learn today?
Web Design Web Development iOS Development

drop down menu colours on mouseover

  • I have made a drop down menu where the top colour is grey. On mouseover the top image changes colour and the drop down menu appears. I want the top colour to stay the same as the mouseover while the drop down menu is there but when you click off the menu the top image reverts back to grey.

    Can anyone help please.
  • if you're using jquery, then in the statement where you add the hover state to your sub menu, just also add it to the top level as well.

    Example:
    $(top level).hover(function(){

    $(sub).show();
    $(top level).css( blah blah);

    });
  • We are using normal css. We are looking for a simple javascript solution without jquery
  • Hai can't we do this without using javascript? by using css?
  • can we have screenshot or complete code snippet