hasClassLike

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-10 08:14:09

软件介绍

hasClassLike allows the selection of elements based on pattern matching rather than specific names. This allows, for example, the passing of parameters to JavaScript via class names:

/* in js, such as in $(document).ready */
$("*")
        .hasClassLike("integer") /* filter some before using regexp */
        .hasClassLike(/^integer(?:Min(-?\d+))?(?:Max(-?\d+))?$/,function(m) {
                var min = m[1];
                var max = m[2];
                // ... install validating event handlers on $(this) ...
        });

<!-- in HTML -->
<input type="text" class="someOtherClass integerMin0"/>
<input type="text" class="integerMin-100Max100 someOtherClass"/>
<input type="text" class="someOtherClass integer yetAnotherClass"/>

There is an efficient simple substring match .hasClassLike(str) matched against the entire className of the element (that is, the space-separated list), useful for paring out unlikely elements. Then, a RegExp match with .hasClassLike(rx) comes back with the elements bearing at least one class matching a given pattern. Adding a callback function with .hasClassLike(rx,fn) makes it easy to modify or filter the found elements based on the match, which is passed to the callback function. If the callback returns false, the element is not included in the output (like with .filter).

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

密码朋克

密码朋克

[澳] 朱利安·阿桑奇 / Gavroche / 中信出版社 / 2017-10 / 42.00元

互联网已经在世界各地掀起了革命,然而全面的打击也正在展开。随着整个社会向互联网迁移,大规模监控计划也正在向全球部署。我们的文明已经来到一个十字路口。道路的一边通往一个承诺“弱者要隐私,强 者要透明”的未来,而另一边则通往一个极权的互联网,在那里,全人类的权力被转移给不受问责的间谍机构综合体及其跨国公司盟友。 密码朋克是一群倡导大规模使用强密码术以保护我们的基本自由免遭攻击的活动家。维基解密的......一起来看看 《密码朋克》 这本书的介绍吧!

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

各进制数互转换器

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换