事件机制
事件被触发后分为两个阶段:捕获(大多数浏览器不支持)和冒泡(实质是事件执行中的顺序)
阻止冒泡 event.stopPropagation(); return false;
1页面载入事件
ready() //$(document).ready(function(){}) $(function(){})
2绑定事件
.bind(type,[data],fn) //type:blur,focus,load,resize,scroll,unload,dbclick,mousedown,mouseup,mousemove,mouseover,
mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error
.bind({type1:fn1},{type2:fn2})
.bind(type,{con:content},function(event){ alert(event.con.content);})
3切换事件
.hover(function(){}, function(){}) .toggle(fn, fn2, [fn3, fn4...]) //轮番调用
4移除事件
.unbind([type],[fn])
5one()
.one(type, [data], fn)
6trigger()
.trigger(type, [data])
表单应用
1文本框中的事件应用
.trigger("focus"); .focus(function(){}); .blur(function(){})
2下拉列表框中的事件应用
.change(function(){})
3列表应用