jQuery Listen

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-09 09:29:47

软件介绍

The release shown below is not the last. Please check 1.0.3 instead.

This plugin brings a clean, light solution, to websites with dynamic loaded content, or full of event bindings.
Intead of bound, handlers for events, are registered along with matching selectors.
And they'll still work for new added content.
This is achieved, using Event delegation, so the plugin will only work for events that bubble.

Update: jQuery.Listen can now handle both focus and blur events thanks to the focusin/focusout workaround.
Many thanks to Jörn Zaefferer for lending me the code!.

The plugin supports these kind of selectors:
- #id
- nodeName
- .class
- nodeName.class
- a comma-separated selector combining these 4.

I plan to add more support, but perfomance and scalability are my priorities. These simple selectors give enough functionality for many cases.

If, for example, you want tables, to react to clicks on it's rows, then you can do this:

jQuery('table').listen( 'click', 'tr', function(){
    alert('you clicked a row!!');
});


No matter how many times you add/remove rows, they will still be clickable.
You can also do this:

jQuery.listen( 'click', 'tr', function(){
    alert('you clicked a row!!');
});


This time, the listener will be the document. So now you can add/remove tables as well, clicking the rows will still trigger the handler.

If you need full support for selectors, and you mind sacrificing a little of scalability, you can check http://plugins.jquery.com/project/Intercept for a similar solution.

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

长尾理论2.0

长尾理论2.0

安德森 / 乔江涛、石晓燕 / 中信出版社 / 2009-5 / 42.00元

《长尾理论2.0》是克里斯·安德森对所有问题最明确的回答。在此书中,他详细阐释了长尾的精华所在,揭示了长尾现象是如何从工业资本主义原动力——规模经济与范围经济——的矛盾中产生出来的。长尾现象虽然是明显的互联网现象,但其商务逻辑本身,却是从工业经济中自然而然“长”出来的,网络只是把酝酿了几十年的供应链革命的诸多要素简单地结合在一起了。同时,长尾理论转化为行动,最有力、最可操作的就是营销长尾,通过口碑......一起来看看 《长尾理论2.0》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具