Intercept
- 授权协议: 未知
- 开发语言:
- 操作系统: 未知
- 软件首页: http://plugins.jquery.com/project/Intercept
软件介绍
This plugin simplifies the use of Event Delegation with multiple different descendants.
This concept is very useful for pages with dynamic content (f.e: AHAH) where DOM elements are created and removed constantly, requiring re-binding.
This method also saves a lot of resources, as it uses less event handlers to achieve the same objective.
It can be used in 2 ways:(I will exemplify with a table)
$('table')
.intercept('click', 'tr', function(e){...})
.intercept('click', 'td.happy', function(e){...})
.intercept('click', '#something', function(e){...});or
$('table').intercept('click', {
tr: function(e){...},
'td.happy': function(e){...},
'#something': function(e){...}
});By calling intercept on the same element/event, the new handler/s are appended to the old list.
jQuery.Intercept won't have such a good perfomance when many different selectors are registered to one element, this can be noted for events that are triggered very often, like mouseover. If you need more scalability, and you can handle your problem with simpler selectors. Then you should check jQuery.Listen instead, for a similar approach.
Since 1.1.2, "absolute" selectors are supported, that is, selectors that specify parents, descendants, siblings. Just use it the way it's normally used.
Thanks to Michael Grosser for bringing up the idea.
文明之光(第一册)
吴军 / 人民邮电出版社 / 2014-6-25 / 59.00元
人类的历史,是从野蛮蒙昧一步步走向文明进步的过程。在文明的进程中,人类创造出多元的文化,它们有着各自的特长。要实现人类和平发展的终极理想,一个重要的前提是承认文化的多元性,并且取长补短,相互融合。 吴军博士写作《文明之光》系列,希望能开阔人们的视野,让我们看到各种各样的人类文明。虽然今天不同的地区发达程度不同,文明历史的长短不一,国家亦有大小之分,但是文明之光从世界的每一个角落发出,对人类的......一起来看看 《文明之光(第一册)》 这本书的介绍吧!
