$(".block li").hover(
function(){
$(this).animate({backgroundColor: "#000"});
},
function(){
$(this).animate({backgroundColor: "#fff"});
}
);
Need to change #fff to no color. Animation should occur from #000 to transparent.
Any solution?
Instead of changing background color, remove that attribute!The code is as simple as:
Example: http://jsfiddle.net/rdWTE/
For it to work, you need jQuery and jQuery UI. Does exactly what you wanted (except the colors)!
Those numbers in jQuery script stand for animation duration in milliseconds.
EDIT:
Uhm… Found out that
toggleClasscan bug from time to time. Better to useaddClasson hover, andremoveClasson mouse out.