我在试着改变元素,但没用。有人能指出我做错了什么吗?
$(document).ready(function(){
$(".navbar").hover(function(){
$(this).css({'background-color': '#ffffff'});
});
});
最佳答案
jquery中的Hover函数需要两个函数:handleIn函数作为第一个参数和handleOut函数。
$(document).ready(function(){
$(".navbar").hover(function(){
$(this).css({'background-color': 'yellow'});
},
function(){
$(this).css({'background-color': 'white'});
});
});