Intercept

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-12 13:27:44

软件介绍

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.

本文地址:https://codercto.com/soft/d/23218.html

运营之光

运营之光

黄有璨 / 电子工业出版社 / 2016-9-1 / 59.00元

在互联网行业内,“运营”这个职能发展到一定阶段后,往往更需要有成熟的知识体系和工作方法来给予行业从业者们以指引。 《运营之光:我的互联网运营方法论与自白》尤其难得之处在于:它既对“什么是运营”这样的概念认知类问题进行了解读,又带有大量实际的工作技巧、工作思维和工作方法,还包含了很多对于运营的思考、宏观分析和建议,可谓内容完整而全面,同时书中加入了作者亲历的大量真实案例,让全书读起来深入浅出、......一起来看看 《运营之光》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具