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

Docker从入门到实战

Docker从入门到实战

黄靖钧 / 机械工业出版社 / 2017-6 / 69.00元

本书从Docker的相关概念与基础知识讲起,结合实际应用,通过不同开发环境的实战例子,详细介绍了Docker的基础知识与进阶实战的相关内容,以引领读者快速入门并提高。 本书共19章,分3篇。第1篇容器技术与Docker概念,涵盖的内容有容器技术、Docker简介、安装Docker等。第2篇Docker基础知识,涵盖的内容有Docker基础、Docker镜像、Dockerfile文件、Dock......一起来看看 《Docker从入门到实战》 这本书的介绍吧!

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

各进制数互转换器

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试