I want now if there is a way to convert these css properties to jquery.hover or manage it with javascript to dynamically change color.
CSS
ul li:hover a { color: #FFF; }
Can anyone help?
EDIT:
My problem:
I have a dropdown menu, and I want that when I hover over a menu to change the color of the text, and when I hover over a submenu, the hang state remains for both.
JQuery
$("ul li").hover(function () { $(this).stop().animate({ backgroundColor: "white"}, 500); }, function () { $(this).stop().animate({ backgroundColor: "black"}, 400); });
Animate the background color when hovering over menus and submenus.
For example, if the text is black, I want the text to be white on hover. For this, I use: (example submenu, to select the selector menu, of course)
$('ul.submenu li a').hover(function () { $(this).css({color:'#FFFFFF'}); }, function () { $(this).css({color:'#00FF00'}); });
All This works fine, but when I find a submenu, the menu returns to its original state (because the mouse is activated upon output). All I want is that when I find a submenu, the hang state in the menu also remains active.
I tried a lot of things, but everyone brings me problems, only the work that works is css, but I also need to dynamically control the colors of the text.
HTML structure:
<ul class="menu"> <li><a href="#">text</a></li> <li><a href="#">text</a> <ul class="submenu"> <li><a href="#">text</a></li> <li><a href="#">text</a></li> <li><a href="#">text</a></li> </ul> </li> <li><a href="#">text</a></li> </ul>