- -这个为什么不能实现,有咩有大神帮忙看看
<html>
<head>
<title>插件</title>
<script type="text/javascript" src="http://www.imooc.com/data/jquery-1.8.2.min.js"></script>
</head>
<body>
<div id="test">
<ul id="hah">
<li>苹果</li>
<li>青提</li>
<li>葡萄</li>
<li>橘子</li>
</ul>
</div>
<script>
(function($){
$.extend({
"focusColor":function(li_col){
var def_col="#ccc";
var lst_col="#fff";
li_col=(li_col==undefined)?def_col:li_col;
$(this).find("li").each(function(){
$(this).mouseover(function(){
$(this).css("background-color",li_col);
}).mouseout(function(){
$(this).css("background-color","#fff");
});
});
return $(this);
};
});
})(jQurey);
$(function(){
$("#hah").focusColor();
});
</script>
</body>
</html>