JQTouch [数据僵尸]:当日历在视图中时,滚动弹回到顶部

时间:2011-06-28 12:25:57

标签: jqtouch

我正在使用[jQTouch-Calendar插件](https://github.com/thingsinjars/jQTouch-Calendar)和DZ's jQTouch fork,我在滚动条弹回到当我尝试查看特定日期的事件时,日历的顶部。 这是我的DOM结构:

<div id="events" class="hide_tabbar">
    <div class="toolbar"> ... </div>
    <div class="s-scrollwrapper">
        <div class="content-area">
            <ul id="event-list">
                <!-- Dynamic Content -->
            </ul>
        </div>
    </div>
</div>

这是生成窗格的JS代码:

function buildEvents() {
    console.log("preparing events view");
    var content = "<ul>";
    for (var x = 0; x < events.length; x++) {
        // 2011-05-30 00:00:00.0
        var eventdate = new Date(events[x].eventdate.replace(
            /^(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d).(\d)$/,
            '$2/$3/$1 $4:$5:$6')
        );

        if (isNaN(eventdate)) continue;

        content += "<li class='arrow'>";
        content += "<time datetime="+ eventdate.format("isoUtcDateTime")+">";
        content += "<a class='event slide plain' href='#event-details' onClick='getEventDetails(\""+events[x].eventrefid+"\")'>";
        content += "<span>"+events[x].eventrefid+"</span>";
        content += "</a></time></li>";
    }

    content += "</ul>";
    $("#event-list").html(content);
    $('#event-list').getCalendar(); //This is the important bit
}

它可以很好地生成日历,但是当我在一天中有几个事件(导致页面大于滚动区域时),当我尝试向下滚动时,滚动条会快速回到顶部。帮助?< / p>

0 个答案:

没有答案