什么是绑定和解除绑定的jQuery什么意思? [英] What does bind and unbind mean in jquery?
问题描述
是什么在白痴缓慢的学习者而言绑定和取消绑定意味着jQuery的?
What does bind and unbind mean in jquery in idiot slow learner terms?
推荐答案
绑定:耦合的处理程序到元素(S),将运行在一个<强>事件发生在所述元件(S)。根据您要处理你会使用不同的功能,如点击什么样的事件(功能)
(ALT:绑定(点击,功能)
或对焦(功能)
(ALT:绑定('专注',功能)
Binding: coupling an handler to an element(s), that will run when an event occurs on said element(s). Depending on what kind of event you want to handle you'd use different functions like click(function)
(alt: bind('click', function)
or focus(function)
(alt: bind('focus', function)
.
涅槃:从元素(S)的处理程序的去耦,这样,当一个事件发生处理函数不会更长远。解除绑定始终是相同的; 解除绑定(点击功能)
来解除绑定某个处理器,解除绑定('点击')
来解除所有的点击处理程序和解除绑定()
解除绑定所有处理程序。您也可以替换点击
其他类型的课程活动。
Unbinding: de-coupling of an handler from an element(s), so that when an event occurs the handler function will no longer run. Unbinding is always the same; unbind('click', function)
to unbind a certain handler, unbind('click')
to unbind ALL click handlers, and unbind()
to unbind ALL handlers. You can substitute click
for other types of events of course.
这篇关于什么是绑定和解除绑定的jQuery什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!