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

赢在用户

赢在用户

[美]Steve Mulder、[美]Zivv Yarr / 范晓燕 / 机械工业出版社 / 2007-08-01 / 29.00

您如何保证您的网站确实给予用户他们所需要的,并对您产生商业成果?您需要了解谁是您的用户,您的用户的目标、行为和观点是什么,还要把他们的需求当成您的第一要务。人物角色将用户研究带入了一个更高的境界,成为实施真正以用户为中心的在线商业策略最高效的工具。本书将伴随您走过创建人物角色的每一个步骤,包括进行定性、定量的用户研究,生成人物角色分类,使人物角色真实可信等。您也将学会如何有效地通过这个工具,来完成......一起来看看 《赢在用户》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

SHA 加密
SHA 加密

SHA 加密工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具