(4)事件处理——(13)复合方法(Compound events)

Most of jQuery's event-handling methods correspond directly to native DOM events. A handful, however, are custom handlers added for convenience and crossbrowser optimization. One of these, the .ready()method, we have discussed in detail already. Others, including .mouseenter(), .mouseleave(), .focusin(), and .focusout(), normalize proprietary Internet Explorer events of the same name. Two custom jQuery handlers, .toggle()and .hover(), are referred to as compoundevent handlersbecause they intercept combinations of user actions, and respond to them using more than one function.

大部分jquery事件处理方法和原生的DOM方法相对应。然而少数的一般处理器被添加进来了,用来提供便利和跨浏览器的兼容性。我们曾经很细节的讨论过的.ready()就是其中之一的方法。另外,括.mouseenter(),.mouseleave(),focusin()和focusout()方法,规范化IE的同名事件。两个一般jquery处理器,.toggle()和.hover()被用来当作复合事件处理器,因为他们拦截了用户的连续事件,同时使用多个函数做出反应。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值