I have a small piece of code that does not work, look:
$(document).ready(function() { $('ul#mainmenu li:hover').css({backgroundColor:''}); $('ul#mainmenu li').hover(function() { $(this).animate({backgroundColor:'#2E8AE5'}, slow); }); });
It meant:
1) remove the CSS background-color property from the list item with the :hover pseudo- :hover in an unordered list with mainmenu identifier (this means that those with Javascript enabled may still look like what I'm trying to achieve with jQuery)
2) When the same list item then freezes, it should be animated in the background color in the specified list item.
But this is not so. Instead, the first task has not yet been completed, not to mention hovering in the background. It is worth noting that I checked the triple elements (I even copied them and pasted them into the script to make sure)).
And I use jQuery UI, which, as I understand it, can perform such tasks associated with animating certain CSS properties. Ideas?
source share