......
<!doctype html>
<html>
<head>
<meta charset="utf-8"></meta>
<script src="http://www.imooc.com/data/jquery-1.8.2.min.js" type="text/javascript"></script>
<script>
/*-------------------------------------/
函数功能:当移到列表项时,背景颜色会发生
改变,移开时又恢复原来的背景色
---------------------------------------*/
;(function($){
$.extend({
"focusColor":function(bgColor){
$("ul li").mouseover(function(){
$(this).css("backgroundColor",bgColor);
}).mouseout(function(){
$(this).css("backgroundColor",'#fff');
});
}
})
})(jQuery)
$(function(){
$.focusColor("#eee");
})
</script>
</head>
<body>
<ul>
<li>第一项</li>
<li>第二项</li>
<li>第三项</li>
</ul>
</body>
</html>