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

当下的冲击

当下的冲击

道格拉斯•洛西科夫 (Douglas Rushkoff) / 孙浩 赵晖 / 中信出版社 / 2013-10-1 / 59.00元

这是一个并不符合人本能的社会…… 为什么我们不应该更注重生活的质量而非速度? 为什么我们不用面对面的交流代替冷冰冰电脑屏幕上的文字代码? 为什么我们不可以选择一个虽然有缺陷但有血有肉的人类社会,而非一个虽趋于完美但冷漠的数字世界? 在当下的冲击面前,你正变得越来越弱智:你没有了自己的独特空间,你过多地相信真人秀节目,你成了数字化产品的奴隶并得了数字化精神病,你的生物钟也被打......一起来看看 《当下的冲击》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

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

在线 XML 格式化压缩工具

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

RGB CMYK 互转工具