Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  33] [ 5]  / answers: 1 / hits: 35118  / 13 Years ago, fri, august 5, 2011, 12:00:00

I have this code



$('#uiAdminPanelMenu li a').hover( function(){
$(this).css('background-color', '#D3E1FA';
},
function(){
$(this).css('background-color', '#F4F4F4');
});


it changes the background color of the link, but I want it to change it slowly, kinda like fade effect, but for this case.


More From » jquery

 Answers
17

You can accomplish the same thing with CSS3 transitions. The result will almost be the exact same.



#uiAdminPanelMenu li a {
background-color: F4F4F4;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-o-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}

#uiAdminPanelMenu li a:hover {
background-color: D3E1FA;
}

[#90812] Wednesday, August 3, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sageallenv

Total Points: 458
Total Questions: 102
Total Answers: 104

Location: Venezuela
Member since Thu, Jul 15, 2021
3 Years ago
;