animate asp.net menu with javascript -


i found javascript code change opacity of asp.net menu items ,

  $(function () {         $("ul.level1 li").hover(function () {             $(this).stop().animate({ opacity: 0.7}, "slow");         }, function () {             $(this).stop().animate({ opacity: 1}, "slow");         });     }); 

but don't want change opacity !
how can if want change items' background color following function ?

$(function () {     $("ul.level1 li").hover(function () {         $(this).stop().animate({ backgroundcolor: red}, "slow");     }, function () {         $(this).stop().animate({ backgroundcolor: blue}, "slow");     }); }); 

you need this

a better method use simple css transition :hover pseudo selector.

update

as said there no native support background color animation in jquery. need include plugin if want in javascript.

still, see how easy make css here


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -