多个class=".class1"的div触发鼠标移入,移出.
$().ready(function(){
$(".class1").mouseover(function (){
$(this).css("background-color","orange");
}).mouseout(function (){
$(this).css("background-color","#D0D0D0");
});
});
首先是相当于window.onload
在jquery的使用
$().ready(function(){
});
然后是.class1触发mouseover(移入)后用$(this)选择是哪个div调用了方法.