【发布时间】:2013-02-08 23:00:09
【问题描述】:
我正在尝试在 jQuery Mobile 的列表视图中设置已读/未读消息的样式集。
<ul data-role="listview" data-theme="c" id="#messageList" style="padding-top:10%;">
<li data-icon="false">
<a href="#" onclick="messageClick()">
<p>
<span style="float:left;clear:left;font-weight: bold;text-decoration:underline;color:blue;white-space:pre-wrap; width:30ex">Some unread text</span>
<span style="float:right;font-weight: bold;">08/02/13</span>
</p>
</a>
</li>
.....
</ul>
里面messageClick()我有:
function messageClick(){
$(this).findclosest("span").css("font-weight","normal");
}
但它似乎不起作用。我哪里错了?
【问题讨论】:
-
您似乎混淆了.closest() 和.find()。没有
.findclosest功能。在这种情况下,您希望.find()搜索后代,closest()搜索祖先。
标签: jquery css jquery-mobile html