我有一个系统警报列表,其日期和时间与它们相关联。日期仅在日期有变时显示。我想要的是最高的日期是在#shell
的顶部,直到另一个替代它。这与联系人应用在iPhone上的工作方式非常相似。在jQuery中模拟iPhone联系人列表标题样式
我有setup a jsFiddle,它有一切在它栏中必要的jQuery代码。如果有人能够帮助我,我会非常感激 - 我目前不知道从哪里开始!
片段HTML的:
<div id="shell">
<div id="alertList">
<div id="alert_0" class="alert">
<span class="date">22 Nov, 2012</span>
<span class="time">02:28</span>
System alert happened
</div>
</div>
</div>
jQuery代码
$("#shell").scroll(function() {
//This is where the code would be to lock (or alter the margin-top) of the
//date would be in order to keep it locked to the top
});
您需要的代码是用于在插入警报后移动日期? – Diego
我知道我需要订阅“滚动”功能,但字面上不知道下一步该怎么做 – Chris
我没有关注你。你希望第一个日期保持在shell的顶部,而不是因为滚动而隐藏“上方”? – Diego