Search code examples
htmlcssmenucolorshover

menu to change colors dynamically


I have a menu on my page which has a set of sub-menu that will be displayed on h-over.

i planned to make the menu to change color dynamically each time i hover.

I like to add a set of colors.

For example

#cccccc;

#999999;

#474747;

#4c4c4c;

These colors must be dynamically changed when i hover I tried to some jquery like this:

$('menu').css('backgroundImage', 'url(something.gif)');

but my plan is to make it only with css. Any idea for this?


Solution

  • $('menu').css('backgroundImage', 'url(something.gif)');
    

    inspite of using image try to use

    $('menu').css('background', '#cccccc');
    
    
    $('menu:hover").css('background', '#999999', '#474747', '#4c4c4c');