我想实现一种效果:鼠标进入Div的时候Div背景色变色,代码我写成下面的样子:
$("#DivId").hover(function () {
$(this).animate({ backgroundColor: "#000"}, 500);
},
function () {
$(this).animate({ backgroundColor: "#fff"}, 500);
});
可是运行以后没有效果- -!!
我查看其他网站js代码后发现有些网站也是这么写的,效果就很好。
请教一下大家到底是哪里出问题了?
$("#DivId").hover(function () {
$(this).animate({ backgroundColor: "#000"}, 500);
},
function () {
$(this).animate({ backgroundColor: "#fff"}, 500);
});
可是运行以后没有效果- -!!
我查看其他网站js代码后发现有些网站也是这么写的,效果就很好。
请教一下大家到底是哪里出问题了?