JQuery Mobile跳过特定元素

时间:2011-06-23 13:34:13

标签: jquery jquery-mobile

有没有办法让jquery mobile跳过特定元素?

我有一个自定义div,看起来像:

<div class="fr-confRoomInfo">
<a href="#" class="fr-confRoomBtn blue ui-link">
<span>Some text</span></a>
</div>

我不想将ui-link应用于该特定div中的标记。有没有办法做到这一点?

修改 我最终在jquery mobile下面移动我的自定义css链接,所以我可以覆盖我需要更改的css参数。所以在我的CSS中我最终做到了这一点:

.fr-confRoomInfo
{
    text-shadow: none;
}

摆脱了实际上从ui-body-c继承的文本阴影(不是ui-link)

2 个答案:

答案 0 :(得分:8)

data-role =“none”是告诉jQuery Mobile忽略您的标记的正确方法

答案 1 :(得分:1)

您可以尝试.not()

$('a').not('.fr-confRoomInfo > a').addClass('ui-link');

或者您可以将其添加到所有内容中,然后将其从要排除的内容中删除:

$('a').addClass('ui-link');
$('.fr-confRoomInfo > a').removeClass('ui-link');

编辑,鉴于您对ui-link总是被添加的评论,只需尝试上面第二个代码段的最后一行。

相关问题