Jquery 的事件方法

1.$(selector).bind(event,data,function,map) //给元素添加一个事件

2.当元素失去焦点时发生 blur 事件,获得焦点时触发focus事件:

$("input").focus(function(){
$(this).css("background-color","#cccccc");
});
$("input").blur(function(){
$(this).css("background-color","#ffffff");
});

3.当元素被改变时触发

$(".field").change(function(){
$(this).css("background-color","#D6D6FF");
});

4.双击时候触发

$(selector).dblclick(function)

5.

posted @ 2016-10-03 22:49  日月心诚  阅读(139)  评论(0编辑  收藏  举报