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

Java语言程序设计

Java语言程序设计

(美) Y. Daniel Liang / 李娜 / 机械工业出版社 / 2011-6 / 75.00元

本书是Java语言的经典教材,多年来畅销不衰。本书全面整合了Java 6的特性,采用“基础优先,问题驱动”的教学方式,循序渐进地介绍了程序设计基础、解决问题的方法、面向对象程序设计、图形用户界面设计、异常处理、I/O和递归等内容。此外,本书还全面且深入地覆盖了一些高级主题,包括算法和数据结构、多线程、网络、国际化、高级GUI等内容。 本书中文版由《Java语言程序设计:基础篇》和《Java语......一起来看看 《Java语言程序设计》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具