jQuery:RTL的第一个词

时间:2013-06-29 16:20:11

标签: jquery right-to-left

我想在我的标题中为第一个单词指定特定的类。现在一切都很好,因为我正在使用LTR方向。

但是现在这个相同的代码想要在RTL中使用而不是得到结果。请帮助..

我现有的LTR代码

$("h1, h2 span#list_box").each(function () {
    var a = $(this);
    if (a.find(".heading").length) {
        a.find(".heading").html(function (b, c) {
            return c.replace(/(\w+\s)/, '<span class="black">$1</span>')
        })
    } else {
        a.html(function (b, c) {
            return c.replace(/(\w+\s)/, '<span class="black">$1</span>')
        })
    }
});

0 个答案:

没有答案