$("li").bind("focus",function()
$("li").bind("focus",function()为什么focus 事件绑定不行
$("li").bind("focus",function()为什么focus 事件绑定不行
2015-12-30
<html>
<head>
<script src="http://www.imooc.com/data/jquery-1.8.2.min.js" type="text/javascript"></script>
<style type="text/css">
li{
margin-bottom: 5px;
list-style: none;
width: 50px;
}
</style>
<body>
<ul>
<li>aaa</li>
<li>bbb</li>
<li>ccc</li>
<li>ddd</li>
<li>eee</li>
<li>fff</li>
</ul>
<script>
(function($){
$.extend({
"changeli":function(li){
li.css("background-color","#ccc");
},
"changeli2":function(li){
li.css("background-color","#fff");
}
});
})(jQuery);
$(function(){
$("li").bind("mouseover",function(){
$.changeli($(this));
})
$("li").bind("mouseout",function(){
$.changeli2($(this));
})
})
</script>
</body>
</head>
</html>
举报