jQuery的事件处理方法介绍 - bind(),live(),delegate(),on()
2012-10-23 22:28
811 查看
http://www.gbin1.com/technology/jquery/20120419jqueryeventhandler/
总的来说,在jquery1.7版本综合了 bind, live delegate 统一用on
下面是几个对应的例子
总的来说,在jquery1.7版本综合了 bind, live delegate 统一用on
下面是几个对应的例子
$('a').bind('click', myHandler); $('a').on('click', myHandler); $('form').bind('submit', { val: 42 }, fn); $('form').on('submit', { val: 42 }, fn); $(window).unbind('scroll.myPlugin'); $(window).off('scroll.myPlugin'); $('.comment').delegate('a.add', 'click', addNew); $('.comment').on('click', 'a.add', addNew); $('.dialog').undelegate('a', 'click.myDlg'); $('.dialog').off('click.myDlg', 'a'); $('a').live('click', fn); $(document).on('click', 'a', fn); $('a').die('click'); $(document).off('click', 'a');
相关文章推荐
- jQuery的事件处理方法介绍 - bind(),live(),delegate(),on()
- jQuery的事件处理方法介绍 - bind(),live(),delegate(),on()
- jQuery的事件处理方法介绍 - bind(),live(),delegate(),on()
- jQuery的事件处理方法介绍 - bind(),live(),delegate(),on()
- jQuery的事件处理方法介绍-bind(),live(),delegate(),on()
- jQuery中事件绑定到bind、live、delegate、on方法的探究
- BIND?LIVE?DELEGATE?还是ON?–JQUERY事件绑定方法研究
- jQuery事件绑定方法bind、 live、delegate和on的区别
- jQuery事件绑定方法bind、 live、delegate和on的区别
- Jquery中的bind、live、delegate、on绑定事件方法的用法
- JQuery中的bind、delegate、on、live方法的区别及简单介绍
- BIND?LIVE?DELEGATE?还是ON?–JQUERY事件绑定方法研究
- jQuery中bind(),live(),delegate(),on()绑定事件方法实例详解
- BIND?LIVE?DELEGATE?还是ON?–JQUERY事件绑定方法研究
- jQuery事件绑定方法bind、 live、delegate和on的区别
- jQuery中事件绑定bind、live、delegate、on方法
- 原生JS事件绑定方法以及jQuery绑定事件方法bind、live、on、delegate的区别
- 浅谈jQuery代码优化之事件委托(事件绑定)——bind()|live()|delegate()|on()|off()|one()方法
- jquery的on、off、one、bind、delegate、live、die绑定事件方法研究
- JQuery中的bind、delegate、on、live方法的区别及简单介绍